Trait bitcoin::network::serialize::SimpleDecoder [] [src]

pub trait SimpleDecoder {
    type Error;
    fn read_u64(&mut self) -> Result<u64, Self::Error>;
    fn read_u32(&mut self) -> Result<u32, Self::Error>;
    fn read_u16(&mut self) -> Result<u16, Self::Error>;
    fn read_u8(&mut self) -> Result<u8, Self::Error>;
    fn read_i64(&mut self) -> Result<i64, Self::Error>;
    fn read_i32(&mut self) -> Result<i32, Self::Error>;
    fn read_i16(&mut self) -> Result<i16, Self::Error>;
    fn read_i8(&mut self) -> Result<i8, Self::Error>;
    fn read_bool(&mut self) -> Result<bool, Self::Error>;
    fn error(&mut self, err: String) -> Self::Error;
}

A simple Decoder trait

Associated Types

type Error

A decoding error

Required Methods

fn read_u64(&mut self) -> Result<u64, Self::Error>

Read a 64-bit uint

fn read_u32(&mut self) -> Result<u32, Self::Error>

Read a 32-bit uint

fn read_u16(&mut self) -> Result<u16, Self::Error>

Read a 16-bit uint

fn read_u8(&mut self) -> Result<u8, Self::Error>

Read a 8-bit uint

fn read_i64(&mut self) -> Result<i64, Self::Error>

Read a 64-bit int

fn read_i32(&mut self) -> Result<i32, Self::Error>

Read a 32-bit int

fn read_i16(&mut self) -> Result<i16, Self::Error>

Read a 16-bit int

fn read_i8(&mut self) -> Result<i8, Self::Error>

Read a 8-bit int

fn read_bool(&mut self) -> Result<bool, Self::Error>

Read a boolean

fn error(&mut self, err: String) -> Self::Error

Signal a decoding error

Implementors