pub struct EventNodeBuilder<A: EventArgs, F, M> { /* private fields */ }Expand description
Helper for declaring event properties.
Implementations§
Source§impl<A: EventArgs, M> EventNodeBuilder<A, (), M>
impl<A: EventArgs, M> EventNodeBuilder<A, (), M>
Sourcepub fn filter<FB, F>(self, filter_builder: FB) -> EventNodeBuilder<A, FB, M>
pub fn filter<FB, F>(self, filter_builder: FB) -> EventNodeBuilder<A, FB, M>
Filter event.
The filter_builder is called on init and on event, it must produce another closure, the filter predicate. The filter_builder
runs in the widget context, the filter predicate does not always.
In the event hook the filter predicate runs in the app context, it is called if the args target the widget, the predicate must use any captured contextual info to filter the args, this is an optimization, it can save a visit to the widget node.
If the event is received the second filter predicate is called again to confirm the event.
The second instance is called if propagation was not stopped, if it returns true the handler closure is called.
Note that events that represent an interaction with the widget are send for both ENABLED and DISABLED targets,
event properties should probably distinguish if they fire on normal interactions vs on disabled interactions.
Source§impl<A: EventArgs, F> EventNodeBuilder<A, F, ()>
impl<A: EventArgs, F> EventNodeBuilder<A, F, ()>
Source§impl<A, F, FB, MA, M> EventNodeBuilder<A, FB, M>
Build with filter and args mapping.
impl<A, F, FB, MA, M> EventNodeBuilder<A, FB, M>
Build with filter and args mapping.
Source§impl<A, F, FB> EventNodeBuilder<A, FB, ()>
Build with filter and without args mapping.
impl<A, F, FB> EventNodeBuilder<A, FB, ()>
Build with filter and without args mapping.
Source§impl<A> EventNodeBuilder<A, (), ()>where
A: EventArgs,
Build without filter and without args mapping.
impl<A> EventNodeBuilder<A, (), ()>where
A: EventArgs,
Build without filter and without args mapping.
Source§impl<A, MA, M> EventNodeBuilder<A, (), M>
Build with no filter and args mapping.
impl<A, MA, M> EventNodeBuilder<A, (), M>
Build with no filter and args mapping.
Auto Trait Implementations§
impl<A, F, M> Freeze for EventNodeBuilder<A, F, M>
impl<A, F, M> RefUnwindSafe for EventNodeBuilder<A, F, M>where
F: RefUnwindSafe,
M: RefUnwindSafe,
impl<A, F, M> Send for EventNodeBuilder<A, F, M>
impl<A, F, M> Sync for EventNodeBuilder<A, F, M>
impl<A, F, M> Unpin for EventNodeBuilder<A, F, M>
impl<A, F, M> UnwindSafe for EventNodeBuilder<A, F, M>where
F: UnwindSafe,
M: UnwindSafe,
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> 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