Trait zenith_types::Coder

source ·
pub trait Coder {
    type Tx: Debug + Clone + PartialEq + Eq;

    // Required methods
    fn encode(t: &Self::Tx) -> Vec<u8> ;
    fn decode(buf: &mut &[u8]) -> Option<Self::Tx>
       where Self: Sized;
}
Expand description

Encode/Decode trait for inner tx type

Required Associated Types§

source

type Tx: Debug + Clone + PartialEq + Eq

The inner tx type.

Required Methods§

source

fn encode(t: &Self::Tx) -> Vec<u8>

Encode the tx.

source

fn decode(buf: &mut &[u8]) -> Option<Self::Tx>
where Self: Sized,

Decode the tx.

Object Safety§

This trait is not object safe.

Implementors§