pub struct ArcCallable<R, E> { /* private fields */ }Expand description
Implementations§
Source§impl<R, E> ArcCallable<R, E>
impl<R, E> ArcCallable<R, E>
Sourcepub fn new<F>(function: F) -> Self
pub fn new<F>(function: F) -> Self
Creates a new callable.
Wraps the provided closure in the appropriate smart pointer type for this callable 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 callable.
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 callable with an optional name.
Wraps the provided closure and assigns it an optional name.
Sourcepub fn from_supplier<S>(supplier: S) -> Self
pub fn from_supplier<S>(supplier: S) -> Self
Sourcepub fn clear_name(&mut self)
pub fn clear_name(&mut self)
Clears the name of this callable.
Trait Implementations§
Source§impl<R, E> Callable<R, E> for ArcCallable<R, E>
impl<R, E> Callable<R, E> for ArcCallable<R, E>
Source§fn into_runnable(self) -> BoxRunnable<E>where
Self: Sized + 'static,
fn into_runnable(self) -> BoxRunnable<E>where
Self: Sized + 'static,
Converts this shared callable into a boxed runnable while preserving its name.
Source§fn into_box(self) -> BoxCallable<R, E>where
Self: 'static,
fn into_box(self) -> BoxCallable<R, E>where
Self: 'static,
Converts this callable into a boxed callable. Read more
Source§fn into_rc(self) -> RcCallable<R, E>where
Self: 'static,
fn into_rc(self) -> RcCallable<R, E>where
Self: 'static,
Converts this callable into an
Rc callable. Read moreSource§fn into_arc(self) -> ArcCallable<R, E>
fn into_arc(self) -> ArcCallable<R, E>
Converts this callable into an
Arc callable. Read moreSource§fn into_fn(self) -> impl FnMut() -> Result<R, E>
fn into_fn(self) -> impl FnMut() -> Result<R, E>
Converts this callable into a mutable closure. Read more
Source§fn into_once(self) -> BoxCallableOnce<R, E>where
Self: 'static,
fn into_once(self) -> BoxCallableOnce<R, E>where
Self: 'static,
Converts this callable into a one-time callable. Read more
Source§fn to_box(&self) -> BoxCallable<R, E>where
Self: 'static,
fn to_box(&self) -> BoxCallable<R, E>where
Self: 'static,
Converts this callable into a boxed callable without consuming
self. Read moreSource§fn to_rc(&self) -> RcCallable<R, E>where
Self: 'static,
fn to_rc(&self) -> RcCallable<R, E>where
Self: 'static,
Source§fn to_arc(&self) -> ArcCallable<R, E>
fn to_arc(&self) -> ArcCallable<R, E>
Source§fn to_fn(&self) -> impl FnMut() -> Result<R, E>
fn to_fn(&self) -> impl FnMut() -> Result<R, E>
Converts this callable into a mutable closure without consuming
self. Read moreSource§fn to_once(&self) -> BoxCallableOnce<R, E>where
Self: 'static,
fn to_once(&self) -> BoxCallableOnce<R, E>where
Self: 'static,
Converts this callable into a one-time callable without consuming
self. Read moreSource§impl<R, E> Clone for ArcCallable<R, E>
impl<R, E> Clone for ArcCallable<R, E>
Source§impl<R, E> Debug for ArcCallable<R, E>
impl<R, E> Debug for ArcCallable<R, E>
Auto Trait Implementations§
impl<R, E> Freeze for ArcCallable<R, E>
impl<R, E> !RefUnwindSafe for ArcCallable<R, E>
impl<R, E> Send for ArcCallable<R, E>
impl<R, E> Sync for ArcCallable<R, E>
impl<R, E> Unpin for ArcCallable<R, E>
impl<R, E> UnsafeUnpin for ArcCallable<R, E>
impl<R, E> !UnwindSafe for ArcCallable<R, 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