pub struct ArcRunnable<E> { /* private fields */ }Expand description
Implementations§
Source§impl<E> ArcRunnable<E>
impl<E> ArcRunnable<E>
Sourcepub fn new<F>(function: F) -> Self
pub fn new<F>(function: F) -> Self
Creates a new runnable.
Wraps the provided closure in the appropriate smart pointer type for this runnable 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.
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 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 runnable.
Trait Implementations§
Source§impl<E> Clone for ArcRunnable<E>
impl<E> Clone for ArcRunnable<E>
Source§impl<E> Runnable<E> for ArcRunnable<E>
impl<E> Runnable<E> for ArcRunnable<E>
Source§fn into_box(self) -> BoxRunnable<E>where
Self: 'static,
fn into_box(self) -> BoxRunnable<E>where
Self: 'static,
Converts this runnable into a boxed runnable. Read more
Source§fn into_rc(self) -> RcRunnable<E>where
Self: 'static,
fn into_rc(self) -> RcRunnable<E>where
Self: 'static,
Converts this runnable into a shared single-threaded runnable. Read more
Source§fn into_arc(self) -> ArcRunnable<E>
fn into_arc(self) -> ArcRunnable<E>
Converts this runnable into a shared thread-safe runnable. Read more
Source§fn into_fn(self) -> impl FnMut() -> Result<(), E>
fn into_fn(self) -> impl FnMut() -> Result<(), E>
Converts this runnable into a mutable closure. Read more
Source§fn to_box(&self) -> BoxRunnable<E>where
Self: 'static,
fn to_box(&self) -> BoxRunnable<E>where
Self: 'static,
Converts this runnable into a boxed runnable without consuming
self. Read moreSource§fn to_rc(&self) -> RcRunnable<E>where
Self: 'static,
fn to_rc(&self) -> RcRunnable<E>where
Self: 'static,
Converts this runnable into a shared single-threaded runnable without
consuming
self. Read moreSource§fn to_arc(&self) -> ArcRunnable<E>
fn to_arc(&self) -> ArcRunnable<E>
Converts this runnable into a shared thread-safe runnable without
consuming
self. Read moreSource§fn to_fn(&self) -> impl FnMut() -> Result<(), E>
fn to_fn(&self) -> impl FnMut() -> Result<(), E>
Converts this runnable into a mutable closure without consuming
self. Read moreSource§fn into_callable(self) -> BoxCallable<(), E>where
Self: Sized + 'static,
fn into_callable(self) -> BoxCallable<(), E>where
Self: Sized + 'static,
Converts this runnable into a callable returning unit. Read more
Auto Trait Implementations§
impl<E> Freeze for ArcRunnable<E>
impl<E> !RefUnwindSafe for ArcRunnable<E>
impl<E> Send for ArcRunnable<E>
impl<E> Sync for ArcRunnable<E>
impl<E> Unpin for ArcRunnable<E>
impl<E> UnsafeUnpin for ArcRunnable<E>
impl<E> !UnwindSafe for ArcRunnable<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