Trait spork::SendToProcess

source ·
pub trait SendToProcess: Sized + 'static {
    // Required methods
    fn encode(value: &Self) -> Result<Vec<u8>, OpaqueError>;
    fn decode(value: Vec<u8>) -> Result<Self, OpaqueError>;
}
Expand description

Send trait but for between processes.

In practice this trait is implemented for any type that can be serialized by serde.

The 'static bound exists because values sent between processes can’t hold references.

Required Methods§

source

fn encode(value: &Self) -> Result<Vec<u8>, OpaqueError>

Encode a value of the type for transfer to another process.

source

fn decode(value: Vec<u8>) -> Result<Self, OpaqueError>

Decode data created by a call to encode to a value of the type.

Implementors§

source§

impl<T> SendToProcess for Twhere T: Serialize + DeserializeOwned + 'static,