Skip to main content

EncodeMessage

Trait EncodeMessage 

Source
pub trait EncodeMessage {
    // Required methods
    fn encode(data: Self) -> Vec<u8> ;
    fn decode(data: Vec<u8>) -> StdResult<Self>
       where Self: Sized;
}

Required Methods§

Source

fn encode(data: Self) -> Vec<u8>

Encodes the data as a proto doc

Source

fn decode(data: Vec<u8>) -> StdResult<Self>
where Self: Sized,

Decodes the data from a proto doc. Only used for tests.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§