Skip to main content

LocalHost

Struct LocalHost 

Source
pub struct LocalHost { /* private fields */ }
Expand description

The default host: commands run in-process with their handlers, the journal is in memory.

Implementations§

Source§

impl LocalHost

Source

pub fn new(store: SharedStore) -> Self

A local host over a store.

Source

pub fn with_layout_document(self, document: Option<&str>) -> Self

Where the layout is kept (see Host::layout_document); None: the application keeps it itself.

Source

pub fn waker(&self) -> Waker

The waker the application gave (to wake it from a thread).

Trait Implementations§

Source§

impl Debug for LocalHost

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LocalHost

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Host for LocalHost

Source§

fn dispatch(&mut self, d: &Dispatch<'_>) -> Reply

Runs a command (its when already holds in d.context).
Source§

fn journal(&self) -> Option<&Journal>

The host’s journal, when it keeps one in memory (LocalHost does). None (the default): the host answers publish, since and last_seq from its own bus, or keeps no journal and egui-pop keeps one.
Source§

fn journal_mut(&mut self) -> Option<&mut Journal>

The host’s journal, to append to.
Source§

fn store(&self) -> SharedStore

The value store holding settings and values.
Source§

fn set_waker(&mut self, waker: Waker)

How to wake the interface; the host calls it from any thread when a result or an event arrives.
Source§

fn layout_document(&self) -> Option<String>

The document the workbench’s layout is kept in, under the application’s persistence directory (AppBuilder::persist): LAYOUT_DOCUMENT by default, a workspace’s own (workspaces/photos/layout), asked again at each load and save. None: egui-pop neither loads nor saves the layout; the host keeps it (AppHandle::layout, AppHandle::set_layout). Loading and saving are the layout.load and layout.save steps.
Source§

fn publish( &mut self, source: &str, cause: Option<Seq>, name: &str, data: Json, ) -> Option<Seq>

Appends an event to the host’s journal; its sequence number, or None when the host keeps no journal (egui-pop’s in-memory one keeps the event then).
Source§

fn since(&self, seq: Seq) -> Option<Vec<Event>>

The events after seq, oldest first; None when the host keeps no journal.
Source§

fn last_seq(&self) -> Option<Seq>

The last sequence number given (0: none yet); None when the host keeps no journal.
Source§

fn history(&mut self) -> Option<&mut dyn History>

The owner of the application’s histories (ADR 0014), when the kernel keeps them. None (the default): egui-pop’s StoreHistory over Host::store, which keeps its newest HISTORY_CAP (500) steps per history; a host keeps more or fewer with Store::set_history_cap. egui-pop owns the keys, the commands and the steps around them (edit.undo, edit.redo, edit.jump); the owner says what an undo is.
Source§

fn set_job_publisher(&mut self, publisher: JobPublisher)

Where the host says its jobs: the application hands it the publisher of pop.job.event when it is built. A host whose kernel runs jobs keeps it and publishes each job fact on it, typed (JobEventKind), from any thread; the jobs centre follows those events only, never journal entries by their name. Ignored by default.
Source§

fn contexts(&mut self) -> Option<&mut dyn Contexts>

The owner of the context stack (places and modes, ADR 0012), when the application’s kernel keeps it. None (the default): egui-pop’s own LocalContexts, kept by ContextsPlugin. The interface only reads it and asks it for transitions; it never writes the stack.
Source§

fn clipboard(&mut self) -> Option<&mut dyn Clipboard>

The owner of the clipboard (ADR 0015), when the application’s kernel keeps it. None (the default): egui-pop’s own LocalClipboard, kept by ClipboardPlugin.
Source§

fn begin_group(&mut self, origin: &Origin, label: &str) -> Option<GestureId>

Opens a history group labelled label (“Paste a colour”): what is written in it until Host::end_group is one undo step. egui-pop opens one around a paste and around a cut’s delete, and AppHandle::group opens one for the application; the writes carry it (Set::gesture). The default opens one through Host::groups, else a group of the store; None: the host groups nothing.
Source§

fn groups(&self) -> Option<Rc<dyn Groups>>

The history groups of a host keeping its own history, for the groups a command opens while the host dispatches it (Call::group). None (the default): such groups are the store’s, as the default Host::begin_group’s are; a host overriding begin_group gives its groups here too, so a command’s groups reach its history.
Source§

fn end_group(&mut self, group: GestureId, keep: bool)

Ends a history group: kept as one undo step, or (keep false) put back as it was.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Downcast<T> for T

§

fn downcast(&self) -> &T

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> NoneValue for T
where T: Default,

§

type NoneType = T

§

fn null_value() -> T

The none-equivalent value.
§

impl<T, S> SimdFrom<T, S> for T
where S: Simd,

§

fn simd_from(_simd: S, value: T) -> T

§

impl<F, T, S> SimdInto<T, S> for F
where T: SimdFrom<F, S>, S: Simd,

§

fn simd_into(self, simd: S) -> T

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> Upcast<T> for T

§

fn upcast(&self) -> Option<&T>

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,