pub struct ActionBuilder { /* private fields */ }Expand description
Fluent builder for Action. Use ActionBuilder::on_invoke for
the common case (handler consumes the intent) or
ActionBuilder::on_invoke_with_response when the handler needs
to decide whether to propagate.
Implementations§
Source§impl ActionBuilder
impl ActionBuilder
Sourcepub fn enabled_when(self, signal: impl Into<Prop<bool>>) -> Self
pub fn enabled_when(self, signal: impl Into<Prop<bool>>) -> Self
Reactive enabled-predicate. When the signal holds false the
action is skipped during dispatch.
Sourcepub fn on_invoke(
self,
f: impl FnMut(&Intent, &mut EventContext<'_>) + 'static,
) -> Action
pub fn on_invoke( self, f: impl FnMut(&Intent, &mut EventContext<'_>) + 'static, ) -> Action
Register a handler that consumes the intent. The handler’s
return value is ignored; the framework treats every invocation
as IntentResponse::Handled.
Sourcepub fn on_invoke_with_response(
self,
f: impl FnMut(&Intent, &mut EventContext<'_>) -> IntentResponse + 'static,
) -> Action
pub fn on_invoke_with_response( self, f: impl FnMut(&Intent, &mut EventContext<'_>) -> IntentResponse + 'static, ) -> Action
Register a handler whose return value decides whether the intent propagates to ancestor widgets. Use when a widget wants to observe an intent (e.g., update a draft status) while still letting an ancestor perform the primary action.
Auto Trait Implementations§
impl !RefUnwindSafe for ActionBuilder
impl !Send for ActionBuilder
impl !Sync for ActionBuilder
impl !UnwindSafe for ActionBuilder
impl Freeze for ActionBuilder
impl Unpin for ActionBuilder
impl UnsafeUnpin for ActionBuilder
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