Trait blaze_pk::codec::Encodable

source ·
pub trait Encodable: Sized {
    // Required method
    fn encode(&self, writer: &mut TdfWriter);

    // Provided method
    fn encode_bytes(&self) -> Vec<u8> { ... }
}
Expand description

Trait for something that can be encoded onto a TdfWriter

Required Methods§

source

fn encode(&self, writer: &mut TdfWriter)

Function for implementing encoding of Self to the provided vec of bytes

writer The output to encode to

Provided Methods§

source

fn encode_bytes(&self) -> Vec<u8>

Shortcut function for encoding self directly to a Vec of bytes

Implementations on Foreign Types§

source§

impl Encodable for String

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for u8

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for u16

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for u64

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for i8

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for usize

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl<C> Encodable for &[C]where C: Encodable + ValueType,

Support for encoding slices of encodable items as lists

source§

fn encode(&self, writer: &mut TdfWriter)

source§

impl Encodable for f32

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for i32

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for u32

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for i64

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl<C> Encodable for Vec<C>where C: Encodable + ValueType,

Vec List encoding for encodable items items are required to have the ValueType trait in order to write the list header

source§

fn encode(&self, writer: &mut TdfWriter)

source§

impl Encodable for i16

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for &str

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for isize

source§

fn encode(&self, output: &mut TdfWriter)

source§

impl Encodable for bool

source§

fn encode(&self, output: &mut TdfWriter)

Implementors§

source§

impl Encodable for Blob

source§

impl<A, B> Encodable for Pair<A, B>where A: VarInt, B: VarInt,

source§

impl<A, B, C> Encodable for Triple<A, B, C>where A: VarInt, B: VarInt, C: VarInt,

source§

impl<C> Encodable for Union<C>where C: Encodable + ValueType,

source§

impl<C> Encodable for VarIntList<C>where C: VarInt,

source§

impl<K, V> Encodable for TdfMap<K, V>where K: Encodable + ValueType, V: Encodable + ValueType,