pub struct AnyExecutor(/* private fields */);
Expand description
A type-erased Executor
that can hold any executor implementation.
This allows for runtime selection of executors and storing different executor types in the same collection.
Implementations§
Source§impl AnyExecutor
impl AnyExecutor
Sourcepub fn new(executor: impl Executor + 'static) -> Self
pub fn new(executor: impl Executor + 'static) -> Self
Create a new AnyExecutor
wrapping the given executor.
Sourcepub fn downcast_ref<E: Executor + 'static>(&self) -> Option<&E>
pub fn downcast_ref<E: Executor + 'static>(&self) -> Option<&E>
Attempt to downcast to a concrete executor type by reference.
Returns Some(&E)
if the underlying executor is of type E
, None
otherwise.
Trait Implementations§
Source§impl Debug for AnyExecutor
impl Debug for AnyExecutor
Source§impl Executor for AnyExecutor
impl Executor for AnyExecutor
Auto Trait Implementations§
impl Freeze for AnyExecutor
impl !RefUnwindSafe for AnyExecutor
impl Send for AnyExecutor
impl Sync for AnyExecutor
impl Unpin for AnyExecutor
impl !UnwindSafe for AnyExecutor
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