pub trait RemotingSerializable {
    type Output;

    // Provided methods
    fn decode<'a>(bytes: &'a [u8]) -> Self::Output
       where Self::Output: Deserialize<'a> { ... }
    fn encode(&self) -> Vec<u8>
       where Self: Serialize { ... }
}
Expand description

A trait for types that can be deserialized from a byte vector.

Required Associated Types§

source

type Output

The output type after deserialization.

Provided Methods§

source

fn decode<'a>(bytes: &'a [u8]) -> Self::Output
where Self::Output: Deserialize<'a>,

Decode a byte vector into the corresponding type.

§Arguments
  • bytes - The byte vector to be deserialized.
§Returns

The deserialized output of type Self::Output.

source

fn encode(&self) -> Vec<u8>
where Self: Serialize,

Object Safety§

This trait is not object safe.

Implementors§