pub struct ContextsPlugin { /* private fields */ }Expand description
The context stack as a plugin: the default owner (a
LocalContexts, unless the host owns the stack), the projection,
the context.request step, the commands and keys, the contexts
collector, the undo toasts.
Implementations§
Source§impl ContextsPlugin
impl ContextsPlugin
Sourcepub fn root(self, title: &str) -> Self
pub fn root(self, title: &str) -> Self
The root crumb’s title, as given (“Home”, translated, by default).
Sourcepub fn root_key(self, key: StrKey) -> Self
pub fn root_key(self, key: StrKey) -> Self
The root crumb’s title, a string of the application’s catalogue translated each time the crumb is said, so it follows the language.
Sourcepub fn root_label(
self,
f: impl Fn(&RootLabelCall<'_>) -> Option<String> + Send + Sync + 'static,
) -> Self
pub fn root_label( self, f: impl Fn(&RootLabelCall<'_>) -> Option<String> + Send + Sync + 'static, ) -> Self
The root crumb’s label, asked each time the crumb is said (the
breadcrumb, the status bar, context.read, the announcement of
where the user is, the undo toast), given the translated title:
the name of what is open (a workspace, a project), read from the
application’s own state, translated with the call’s ctx. None
keeps the title. Like FrameSpec::label it is called while the
interface draws: it reads what the application keeps (behind an
Arc it captured), never the context stack itself.
Trait Implementations§
Source§impl Debug for ContextsPlugin
impl Debug for ContextsPlugin
Source§impl Default for ContextsPlugin
impl Default for ContextsPlugin
Source§fn default() -> ContextsPlugin
fn default() -> ContextsPlugin
Source§impl Plugin for ContextsPlugin
impl Plugin for ContextsPlugin
fn id(&self) -> PluginId
Source§fn title(&self) -> String
fn title(&self) -> String
Source§fn enabled(&self, _ctx: &Ctx<'_>) -> bool
fn enabled(&self, _ctx: &Ctx<'_>) -> bool
Source§fn disconnect(&mut self, _ctx: &mut Ctx<'_>)
fn disconnect(&mut self, _ctx: &mut Ctx<'_>)
Auto Trait Implementations§
impl Freeze for ContextsPlugin
impl !RefUnwindSafe for ContextsPlugin
impl Send for ContextsPlugin
impl Sync for ContextsPlugin
impl Unpin for ContextsPlugin
impl UnsafeUnpin for ContextsPlugin
impl !UnwindSafe for ContextsPlugin
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
§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>
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>
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)
&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)
&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>
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>
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