Skip to main content

WireCodec

Trait WireCodec 

Source
pub trait WireCodec:
    Clone
    + Send
    + Sync
    + 'static {
    // Required methods
    fn encode<T: RemoteSafe>(
        &self,
        value: &T,
    ) -> Result<Vec<u8>, WireCodecError>;
    fn decode<T: RemoteSafe>(&self, bytes: Vec<u8>) -> Result<T, WireCodecError>;
}

Required Methods§

Source

fn encode<T: RemoteSafe>(&self, value: &T) -> Result<Vec<u8>, WireCodecError>

Source

fn decode<T: RemoteSafe>(&self, bytes: Vec<u8>) -> Result<T, WireCodecError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§