bitcoin::consensus::encode

Trait 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 Write to encode data as per Bitcoin consensus.

Required Methods§

Source

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

Outputs a 64-bit unsigned integer.

Source

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

Outputs a 32-bit unsigned integer.

Source

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

Outputs a 16-bit unsigned integer.

Source

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

Outputs an 8-bit unsigned integer.

Source

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

Outputs a 64-bit signed integer.

Source

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

Outputs a 32-bit signed integer.

Source

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

Outputs a 16-bit signed integer.

Source

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

Outputs an 8-bit signed integer.

Source

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

Outputs a boolean.

Source

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

Outputs a byte slice.

Implementors§

Source§

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