[][src]Trait haiku::support::Flattenable

pub trait Flattenable<T> {
    fn type_code() -> u32;
fn is_fixed_size() -> bool;
fn flattened_size(&self) -> usize;
fn flatten(&self) -> Vec<u8>;
fn unflatten(_: &[u8]) -> Result<T>; }

An interface for types that are flattenable

Required methods

fn type_code() -> u32

The type code is a unique identifier that identifies the flattened data

fn is_fixed_size() -> bool

Check if flattened objects of this type are always a fixed size

fn flattened_size(&self) -> usize

Return the size of the flattened type

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

Return a flattened version of this object

fn unflatten(_: &[u8]) -> Result<T>

Unflatten an object from a stream

Loading content...

Implementations on Foreign Types

impl Flattenable<bool> for bool[src]

impl Flattenable<i8> for i8[src]

impl Flattenable<i16> for i16[src]

impl Flattenable<i32> for i32[src]

impl Flattenable<i64> for i64[src]

impl Flattenable<u8> for u8[src]

impl Flattenable<u16> for u16[src]

impl Flattenable<u32> for u32[src]

impl Flattenable<u64> for u64[src]

impl Flattenable<f32> for f32[src]

impl Flattenable<f64> for f64[src]

impl Flattenable<String> for String[src]

Loading content...

Implementors

impl Flattenable<Message> for Message[src]

Loading content...