pub struct BaseInvoker {}Expand description
Struct that provides an empty Invoker implementation.
Trait Implementations§
Source§impl Invoker for BaseInvoker
impl Invoker for BaseInvoker
Source§fn pre_invoke(&self)
fn pre_invoke(&self)
Called by
invoke_with_mode_optional before
invoking each task. Can be used to run code before a task is invoked.Source§fn invoke_with_mode<'f, T: 'f, F: FnOnce() -> T + 'f>(
&'f self,
mode: &'f Mode<'f, T>,
task: F,
) -> T
fn invoke_with_mode<'f, T: 'f, F: FnOnce() -> T + 'f>( &'f self, mode: &'f Mode<'f, T>, task: F, ) -> T
Invoke a task with a
Mode. The default implementation for do_invoke
delegates to crate::invoke if a mode was supplied. The Mode is applied to
the task invoked by this Invoker, meaning the task of modes will run inside the
do_invoke invocation so that logic run by
the invoker before the task runs executes before the modes and logic run by the
invoker after the task executes after the modes.Source§fn invoke_with_mode_optional<'f, T: 'f, F: FnOnce() -> T + 'f>(
&'f self,
mode: Option<&'f Mode<'f, T>>,
task: F,
) -> T
fn invoke_with_mode_optional<'f, T: 'f, F: FnOnce() -> T + 'f>( &'f self, mode: Option<&'f Mode<'f, T>>, task: F, ) -> T
Source§fn do_invoke<'f, T: 'f, F: FnOnce() -> T + 'f>(
&'f self,
mode: Option<&'f Mode<'f, T>>,
task: F,
) -> T
fn do_invoke<'f, T: 'f, F: FnOnce() -> T + 'f>( &'f self, mode: Option<&'f Mode<'f, T>>, task: F, ) -> T
Core function responsible for actually invoking the task. This allows implementors to easily override
how tasks are invoked without having to worry about doing any administrative tasks such as calling
pre_invoke and post_invoke
as would be the case when overriding invoke_with_mode_optional.Source§fn post_invoke(&self)
fn post_invoke(&self)
Called by
invoke_with_mode_optional after
invoking each task. Can be used to run code after a task is invoked.Source§fn invoke_post_invoke_on_panic(&self) -> bool
fn invoke_post_invoke_on_panic(&self) -> bool
Return true if
post_invoke should be called even if
the task panicked using a Sentinel, defaults to false.Source§fn and_then<I: Invoker>(self, inner: I) -> CombinedInvoker<Self, I>where
Self: Sized,
fn and_then<I: Invoker>(self, inner: I) -> CombinedInvoker<Self, I>where
Self: Sized,
Combines this
Invoker with another Invoker by creating a CombinedInvoker
that invokes tasks by first calling this Invoker with a task that submits the supplied task to the
other Invoker, meaning the other Invoker will run inside this Invoker in such a way that the logic
of this Invoker that runs before the task executes before the logic of the other Invoker but the logic
of this Invoker that runs after the task executes after the logic of the other Invoker.Auto Trait Implementations§
impl Freeze for BaseInvoker
impl RefUnwindSafe for BaseInvoker
impl Send for BaseInvoker
impl Sync for BaseInvoker
impl Unpin for BaseInvoker
impl UnwindSafe for BaseInvoker
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