pub enum WorkerReconstructor {
Sync(Arc<dyn Fn(Arc<dyn Any + Send + Sync>, Arc<dyn DependencyView + Send + Sync>) -> Arc<dyn Any + Send + Sync> + Send + Sync>),
Async(Arc<dyn Fn(Arc<dyn Any + Send + Sync>, Arc<dyn DependencyView + Send + Sync>) -> Pin<Box<dyn Future<Output = Arc<dyn Any + Send + Sync>>>> + Send + Sync>),
}Expand description
Function pointer-equivalent used by the worker side of a Cloneable
dependency. Receives the deserialized wire payload (boxed as Any for
type erasure) plus the current dependency view, and produces the
reconstructed worker-side value.
Variants§
Sync(Arc<dyn Fn(Arc<dyn Any + Send + Sync>, Arc<dyn DependencyView + Send + Sync>) -> Arc<dyn Any + Send + Sync> + Send + Sync>)
Async(Arc<dyn Fn(Arc<dyn Any + Send + Sync>, Arc<dyn DependencyView + Send + Sync>) -> Pin<Box<dyn Future<Output = Arc<dyn Any + Send + Sync>>>> + Send + Sync>)
Trait Implementations§
Source§impl Clone for WorkerReconstructor
impl Clone for WorkerReconstructor
Source§fn clone(&self) -> WorkerReconstructor
fn clone(&self) -> WorkerReconstructor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WorkerReconstructor
impl !RefUnwindSafe for WorkerReconstructor
impl Send for WorkerReconstructor
impl Sync for WorkerReconstructor
impl Unpin for WorkerReconstructor
impl UnsafeUnpin for WorkerReconstructor
impl !UnwindSafe for WorkerReconstructor
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