pub struct Action {
pub intent: &'static str,
pub handler: ActionHandler,
pub enabled_when: Option<Prop<bool>>,
}Expand description
A widget-owned handler bound to a named intent.
Fields§
§intent: &'static strThe intent name this action responds to. Matches against
Intent::name during dispatch.
handler: ActionHandlerInvoked when a matching intent is dispatched to this widget.
enabled_when: Option<Prop<bool>>Reactive “is this action currently applicable?” predicate.
None means always enabled.
Disabled semantics at dispatch time: the intent propagates past
this action as if no match existed here, unless the firing
Shortcut has
propagate_when_disabled == false, in which case the intent
is consumed (dormant) at this level.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Action
impl !Send for Action
impl !Sync for Action
impl !UnwindSafe for Action
impl Freeze for Action
impl Unpin for Action
impl UnsafeUnpin for Action
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