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
impl LocalHost
Sourcepub fn new(store: SharedStore) -> Self
pub fn new(store: SharedStore) -> Self
A local host over a store.
Sourcepub fn with_layout_document(self, document: Option<&str>) -> Self
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.
Trait Implementations§
Source§impl Host for LocalHost
impl Host for LocalHost
Source§fn dispatch(&mut self, d: &Dispatch<'_>) -> Reply
fn dispatch(&mut self, d: &Dispatch<'_>) -> Reply
Runs a command (its
when already holds in d.context).Source§fn journal(&self) -> Option<&Journal>
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>
fn journal_mut(&mut self) -> Option<&mut Journal>
The host’s journal, to append to.
Source§fn store(&self) -> SharedStore
fn store(&self) -> SharedStore
The value store holding settings and values.
Source§fn set_waker(&mut self, waker: Waker)
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>
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>
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>>
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>
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>
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)
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>
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>
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>
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>>
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.Auto Trait Implementations§
impl Freeze for LocalHost
impl !RefUnwindSafe for LocalHost
impl Send for LocalHost
impl Sync for LocalHost
impl Unpin for LocalHost
impl UnsafeUnpin for LocalHost
impl !UnwindSafe for LocalHost
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn 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>
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)
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)
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
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.