pub struct BoxRunnableWith<T, E> { /* private fields */ }Expand description
Box-based runnable with mutable input.
BoxRunnableWith<T, E> stores a
Box<dyn FnMut(&mut T) -> Result<(), E>> and can be called repeatedly.
§Author
Haixing Hu
Implementations§
Source§impl<T, E> BoxRunnableWith<T, E>
impl<T, E> BoxRunnableWith<T, E>
Sourcepub fn new<F>(function: F) -> Self
pub fn new<F>(function: F) -> Self
Creates a new runnable-with.
Wraps the provided closure in the appropriate smart pointer type for this runnable-with implementation.
Sourcepub fn new_with_name<F>(name: &str, function: F) -> Self
pub fn new_with_name<F>(name: &str, function: F) -> Self
Creates a new named runnable-with.
Wraps the provided closure and assigns it a name, which is useful for debugging and logging purposes.
Sourcepub fn new_with_optional_name<F>(function: F, name: Option<String>) -> Self
pub fn new_with_optional_name<F>(function: F, name: Option<String>) -> Self
Creates a new named runnable-with with an optional name.
Wraps the provided closure and assigns it an optional name.
Sourcepub fn clear_name(&mut self)
pub fn clear_name(&mut self)
Clears the name of this runnable-with.
Sourcepub fn and_then<N>(self, next: N) -> BoxRunnableWith<T, E>where
N: RunnableWith<T, E> + 'static,
T: 'static,
E: 'static,
pub fn and_then<N>(self, next: N) -> BoxRunnableWith<T, E>where
N: RunnableWith<T, E> + 'static,
T: 'static,
E: 'static,
Sourcepub fn then_callable_with<R, C>(self, callable: C) -> BoxCallableWith<T, R, E>where
C: CallableWith<T, R, E> + 'static,
T: 'static,
R: 'static,
E: 'static,
pub fn then_callable_with<R, C>(self, callable: C) -> BoxCallableWith<T, R, E>where
C: CallableWith<T, R, E> + 'static,
T: 'static,
R: 'static,
E: 'static,
Trait Implementations§
Source§impl<T, E> Debug for BoxRunnableWith<T, E>
impl<T, E> Debug for BoxRunnableWith<T, E>
Source§impl<T, E> Display for BoxRunnableWith<T, E>
impl<T, E> Display for BoxRunnableWith<T, E>
Source§impl<T, E> RunnableWith<T, E> for BoxRunnableWith<T, E>
impl<T, E> RunnableWith<T, E> for BoxRunnableWith<T, E>
Source§fn run_with(&mut self, input: &mut T) -> Result<(), E>
fn run_with(&mut self, input: &mut T) -> Result<(), E>
Executes the boxed runnable with mutable input.
Source§fn into_callable_with(self) -> BoxCallableWith<T, (), E>where
Self: Sized + 'static,
fn into_callable_with(self) -> BoxCallableWith<T, (), E>where
Self: Sized + 'static,
Converts this boxed runnable into a boxed callable while preserving its name.
Source§fn into_box(self) -> BoxRunnableWith<T, E>
fn into_box(self) -> BoxRunnableWith<T, E>
Converts this runnable into a boxed runnable. Read more
Source§fn into_rc(self) -> RcRunnableWith<T, E>where
Self: 'static,
fn into_rc(self) -> RcRunnableWith<T, E>where
Self: 'static,
Converts this runnable into an
Rc runnable. Read moreAuto Trait Implementations§
impl<T, E> Freeze for BoxRunnableWith<T, E>
impl<T, E> !RefUnwindSafe for BoxRunnableWith<T, E>
impl<T, E> !Send for BoxRunnableWith<T, E>
impl<T, E> !Sync for BoxRunnableWith<T, E>
impl<T, E> Unpin for BoxRunnableWith<T, E>
impl<T, E> UnsafeUnpin for BoxRunnableWith<T, E>
impl<T, E> !UnwindSafe for BoxRunnableWith<T, E>
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