Trait obi::dec::OBIDecode[][src]

pub trait OBIDecode: Sized {
    fn decode(buf: &mut &[u8]) -> Result<Self>;

    fn try_from_slice(v: &[u8]) -> Result<Self> { ... }
fn is_u8() -> bool { ... } }

A data-structure that can be de-serialized from binary format by NBOR.

Required methods

fn decode(buf: &mut &[u8]) -> Result<Self>[src]

Decodes this instance from a given slice of bytes. Updates the buffer to point at the remaining bytes.

Loading content...

Provided methods

fn try_from_slice(v: &[u8]) -> Result<Self>[src]

Decode this instance from a slice of bytes.

fn is_u8() -> bool[src]

Whether Self is u8. NOTE: Vec<u8> is the most common use-case for serialization and deserialization, it’s worth handling it as a special case to improve performance. It’s a workaround for specific Vec<u8> implementation versus generic Vec<T> implementation. See https://github.com/rust-lang/rfcs/pull/1210 for details.

Loading content...

Implementations on Foreign Types

impl OBIDecode for u8[src]

impl OBIDecode for i8[src]

impl OBIDecode for i16[src]

impl OBIDecode for i32[src]

impl OBIDecode for i64[src]

impl OBIDecode for i128[src]

impl OBIDecode for u16[src]

impl OBIDecode for u32[src]

impl OBIDecode for u64[src]

impl OBIDecode for u128[src]

impl OBIDecode for bool[src]

impl<T> OBIDecode for Vec<T> where
    T: OBIDecode
[src]

impl OBIDecode for String[src]

Loading content...

Implementors

Loading content...