Trait Encodable

Source
pub trait Encodable {
    // Required method
    fn encode(&self, bf: &mut Bufferfish) -> Result<(), BufferfishError>;

    // Provided method
    fn to_bufferfish(&self) -> Result<Bufferfish, BufferfishError> { ... }
}
Expand description

Types implementing this trait are able to be encoded to a Bufferfish.

Required Methods§

Source

fn encode(&self, bf: &mut Bufferfish) -> Result<(), BufferfishError>

Encode the type into a given Bufferfish.

Provided Methods§

Source

fn to_bufferfish(&self) -> Result<Bufferfish, BufferfishError>

Encode the type into a new Bufferfish.

Implementations on Foreign Types§

Source§

impl Encodable for bool

Source§

impl Encodable for i8

Source§

impl Encodable for i16

Source§

impl Encodable for i32

Source§

impl Encodable for u8

Source§

impl Encodable for u16

Source§

impl Encodable for u32

Source§

impl Encodable for String

Implementors§