pub struct Once<F, Context, Outcome> { /* private fields */ }
Expand description
A type that implements Query and QueryMut traits and only executes once.
This will execute and short-circuit on the first match.
Implementations§
source§impl<F, ConnectionContext, Outcome> Once<F, ConnectionContext, Outcome>where
F: FnOnce(&ConnectionContext) -> Outcome,
ConnectionContext: 'static,
impl<F, ConnectionContext, Outcome> Once<F, ConnectionContext, Outcome>where
F: FnOnce(&ConnectionContext) -> Outcome,
ConnectionContext: 'static,
Trait Implementations§
source§impl<F, Context, Outcome> Query for Once<F, Context, Outcome>
impl<F, Context, Outcome> Query for Once<F, Context, Outcome>
fn execute(&mut self, context: &(dyn Any + 'static)) -> ControlFlow
source§impl<F, Context, Outcome> QueryMut for Once<F, Context, Outcome>where
F: FnOnce(&mut Context) -> Outcome,
Context: 'static,
impl<F, Context, Outcome> QueryMut for Once<F, Context, Outcome>where
F: FnOnce(&mut Context) -> Outcome,
Context: 'static,
fn execute_mut(&mut self, context: &mut (dyn Any + 'static)) -> ControlFlow
Auto Trait Implementations§
impl<F, Context, Outcome> Freeze for Once<F, Context, Outcome>
impl<F, Context, Outcome> RefUnwindSafe for Once<F, Context, Outcome>
impl<F, Context, Outcome> Send for Once<F, Context, Outcome>
impl<F, Context, Outcome> Sync for Once<F, Context, Outcome>
impl<F, Context, Outcome> Unpin for Once<F, Context, Outcome>
impl<F, Context, Outcome> UnwindSafe for Once<F, Context, Outcome>
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