Trait oasis_core_runtime::storage::mkvs::marshal::Marshal

source ·
pub trait Marshal {
    // Required methods
    fn marshal_binary(&self) -> Result<Vec<u8>>;
    fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>;
}
Expand description

The Marshal trait is used for marshaling and unmarshaling MKVS trees.

Required Methods§

source

fn marshal_binary(&self) -> Result<Vec<u8>>

Marshal the object into a binary form and return it as a new vector.

source

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

Unmarshal from the given byte slice reference and modify self.

Implementations on Foreign Types§

source§

impl Marshal for u16

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

source§

impl Marshal for u32

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

source§

impl Marshal for u64

source§

fn marshal_binary(&self) -> Result<Vec<u8>>

source§

fn unmarshal_binary(&mut self, data: &[u8]) -> Result<usize>

Implementors§