Struct zng_app::event::CommandHandle
source · pub struct CommandHandle { /* private fields */ }
Expand description
A handle to a Command
subscription.
Holding the command handle indicates that the command is relevant in the current app state. The handle needs to be enabled to indicate that the command primary action can be executed.
You can use the Command::subscribe
method in a command type to create a handle.
Implementations§
source§impl CommandHandle
impl CommandHandle
sourcepub fn set_enabled(&self, enabled: bool)
pub fn set_enabled(&self, enabled: bool)
Sets if the command event handler is active.
When at least one CommandHandle
is enabled the command is is_enabled
.
sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Returns if this handle has enabled the command.
Trait Implementations§
source§impl Debug for CommandHandle
impl Debug for CommandHandle
source§impl Default for CommandHandle
impl Default for CommandHandle
Auto Trait Implementations§
impl !Freeze for CommandHandle
impl !RefUnwindSafe for CommandHandle
impl Send for CommandHandle
impl Sync for CommandHandle
impl Unpin for CommandHandle
impl !UnwindSafe for CommandHandle
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> 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