Trait monero::consensus::encode::WriteExt

source ·
pub trait WriteExt: Write {
    // Required methods
    fn emit_u64(&mut self, v: u64) -> Result<(), Error>;
    fn emit_u32(&mut self, v: u32) -> Result<(), Error>;
    fn emit_u16(&mut self, v: u16) -> Result<(), Error>;
    fn emit_u8(&mut self, v: u8) -> Result<(), Error>;
    fn emit_i64(&mut self, v: i64) -> Result<(), Error>;
    fn emit_i32(&mut self, v: i32) -> Result<(), Error>;
    fn emit_i16(&mut self, v: i16) -> Result<(), Error>;
    fn emit_i8(&mut self, v: i8) -> Result<(), Error>;
    fn emit_bool(&mut self, v: bool) -> Result<(), Error>;
    fn emit_slice(&mut self, v: &[u8]) -> Result<(), Error>;
}
Expand description

Extensions of io::Write to encode data as per Monero consensus.

Required Methods§

source

fn emit_u64(&mut self, v: u64) -> Result<(), Error>

Output a 64-bit uint.

source

fn emit_u32(&mut self, v: u32) -> Result<(), Error>

Output a 32-bit uint.

source

fn emit_u16(&mut self, v: u16) -> Result<(), Error>

Output a 16-bit uint.

source

fn emit_u8(&mut self, v: u8) -> Result<(), Error>

Output a 8-bit uint.

source

fn emit_i64(&mut self, v: i64) -> Result<(), Error>

Output a 64-bit int.

source

fn emit_i32(&mut self, v: i32) -> Result<(), Error>

Output a 32-bit int.

source

fn emit_i16(&mut self, v: i16) -> Result<(), Error>

Output a 16-bit int.

source

fn emit_i8(&mut self, v: i8) -> Result<(), Error>

Output a 8-bit int.

source

fn emit_bool(&mut self, v: bool) -> Result<(), Error>

Output a boolean.

source

fn emit_slice(&mut self, v: &[u8]) -> Result<(), Error>

Output a byte slice.

Implementors§

source§

impl<W: Write + ?Sized> WriteExt for W