pub struct CloneableCodec {
pub to_wire: Arc<dyn Fn(Arc<dyn Any + Send + Sync>) -> Vec<u8> + Send + Sync>,
pub from_wire_bytes: Arc<dyn Fn(&[u8]) -> Arc<dyn Any + Send + Sync> + Send + Sync>,
}Expand description
Function-pointer wrappers used by Cloneable deps to convert the constructed value into wire bytes on the parent, and to deserialize those bytes into a typed value on the worker.
Fields§
§to_wire: Arc<dyn Fn(Arc<dyn Any + Send + Sync>) -> Vec<u8> + Send + Sync>Parent-side: to_wire. Receives the dependency value as Arc<dyn Any>,
returns the encoded wire bytes.
from_wire_bytes: Arc<dyn Fn(&[u8]) -> Arc<dyn Any + Send + Sync> + Send + Sync>Worker-side: deserialize wire bytes into the boxed Wire payload that
is then fed to the WorkerReconstructor.
Trait Implementations§
Source§impl Clone for CloneableCodec
impl Clone for CloneableCodec
Source§fn clone(&self) -> CloneableCodec
fn clone(&self) -> CloneableCodec
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 CloneableCodec
impl !RefUnwindSafe for CloneableCodec
impl Send for CloneableCodec
impl Sync for CloneableCodec
impl Unpin for CloneableCodec
impl UnsafeUnpin for CloneableCodec
impl !UnwindSafe for CloneableCodec
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