Trait codec::number::NumberDecoder[][src]

pub trait NumberDecoder: BufferReader {
    fn read_u8(&mut self) -> Result<u8> { ... }
fn read_u16(&mut self) -> Result<u16> { ... }
fn read_u32(&mut self) -> Result<u32> { ... }
fn read_u64(&mut self) -> Result<u64> { ... }
fn read_u64_desc(&mut self) -> Result<u64> { ... }
fn read_i64(&mut self) -> Result<i64> { ... }
fn read_i64_desc(&mut self) -> Result<i64> { ... }
fn read_f64(&mut self) -> Result<f64> { ... }
fn read_f64_desc(&mut self) -> Result<f64> { ... }
fn read_u16_le(&mut self) -> Result<u16> { ... }
fn read_i16_le(&mut self) -> Result<i16> { ... }
fn read_u32_le(&mut self) -> Result<u32> { ... }
fn read_i32_le(&mut self) -> Result<i32> { ... }
fn read_f32_le(&mut self) -> Result<f32> { ... }
fn read_u64_le(&mut self) -> Result<u64> { ... }
fn read_i64_le(&mut self) -> Result<i64> { ... }
fn read_f64_le(&mut self) -> Result<f64> { ... }
fn read_var_u64(&mut self) -> Result<u64> { ... }
fn read_var_i64(&mut self) -> Result<i64> { ... } }

Provided methods

fn read_u8(&mut self) -> Result<u8>[src]

Reads an unsigned 8 bit integer, which is previously wrote via write_u8.

Errors

Returns Error::Io if buffer remaining size < 1.

fn read_u16(&mut self) -> Result<u16>[src]

Reads an unsigned 16 bit integer, which is previously wrote via write_u16.

Errors

Returns Error::Io if buffer remaining size < 2.

fn read_u32(&mut self) -> Result<u32>[src]

Reads an unsigned 32 bit integer, which is previously wrote via write_u32.

Errors

Returns Error::Io if buffer remaining size < 4.

fn read_u64(&mut self) -> Result<u64>[src]

Reads an unsigned 64 bit integer, which is previously wrote via write_u64.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_u64_desc(&mut self) -> Result<u64>[src]

Reads an unsigned 64 bit integer, which is previously wrote via write_u64_desc.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_i64(&mut self) -> Result<i64>[src]

Reads a signed 64 bit integer, which is previously wrote via write_i64.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_i64_desc(&mut self) -> Result<i64>[src]

Reads a signed 64 bit integer, which is previously wrote via write_i64_desc.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_f64(&mut self) -> Result<f64>[src]

Reads a 64 bit float number, which is previously wrote via write_f64.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_f64_desc(&mut self) -> Result<f64>[src]

Reads a 64 bit float number, which is previously wrote via write_f64_desc.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_u16_le(&mut self) -> Result<u16>[src]

Reads an unsigned 16 bit integer in little endian, which is previously wrote via write_u16_le.

Errors

Returns Error::Io if buffer remaining size < 2.

fn read_i16_le(&mut self) -> Result<i16>[src]

Reads a signed 16 bit integer in little endian, which is previously wrote via write_i16_le.

Errors

Returns Error::Io if buffer remaining size < 2.

fn read_u32_le(&mut self) -> Result<u32>[src]

Reads an unsigned 32 bit integer in little endian, which is previously wrote via write_u32_le.

Errors

Returns Error::Io if buffer remaining size < 4.

fn read_i32_le(&mut self) -> Result<i32>[src]

Reads a signed 32 bit integer in little endian, which is previously wrote via write_i32_le.

Errors

Returns Error::Io if buffer remaining size < 4.

fn read_f32_le(&mut self) -> Result<f32>[src]

Reads a 32 bit float in little endian, which is previously wrote via write_f32_le.

Errors

Returns Error::Io if buffer remaining size < 4.

fn read_u64_le(&mut self) -> Result<u64>[src]

Reads an unsigned 64 bit integer in little endian, which is previously wrote via write_u64_le.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_i64_le(&mut self) -> Result<i64>[src]

Reads a signed 64 bit integer in little endian, which is previously wrote via write_i64_le.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_f64_le(&mut self) -> Result<f64>[src]

Reads a 64 bit float number in little endian, which is previously wrote via write_f64_le.

Errors

Returns Error::Io if buffer remaining size < 8.

fn read_var_u64(&mut self) -> Result<u64>[src]

Decodes an unsigned 64 bit integer in VarInt encoding, which is previously wrote via write_var_u64.

This function is more efficient when remaining buffer size >= 10.

Errors

Returns Error::Io if there is not enough space to decode the whole VarInt.

fn read_var_i64(&mut self) -> Result<i64>[src]

Decodes a signed 64 bit integer in VarInt encoding, which is previously wrote via write_var_i64.

This function is more efficient when remaining buffer size >= 10.

Errors

Returns Error::Io if there is not enough space to decode the whole VarInt.

Loading content...

Implementors

impl<T: BufferReader> NumberDecoder for T[src]

Any types who implemented BufferReader also implements NumberDecoder.

Loading content...