Skip to main content

Codec

Trait Codec 

Source
pub trait Codec: Send + Sync {
    // Required methods
    fn packed(&self, value: &Value) -> Result<Value, CodecError>;
    fn unpacked(&self, value: &Value) -> Result<Value, CodecError>;
}
Expand description

Writes down what cannot leave a process, and reads it back.

Required Methods§

Source

fn packed(&self, value: &Value) -> Result<Value, CodecError>

This value in a shape that can leave the process, at any depth. Whatever carries nothing opaque comes back as it was: this is asked of every value that crosses.

Source

fn unpacked(&self, value: &Value) -> Result<Value, CodecError>

And the live one back, on the side that will use it.

Implementors§