pub trait BytesRead {
Show 29 methods fn as_slice(&self) -> &[u8]
Notable traits for &'_ mut [u8]
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
;
fn remaining(&self) -> &[u8]
Notable traits for &'_ mut [u8]
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
;
fn read(&mut self, len: usize) -> &[u8]
Notable traits for &'_ mut [u8]
impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
;
fn peek(&self, len: usize) -> Option<&[u8]>; fn len(&self) -> usize { ... }
fn read_u8(&mut self) -> u8 { ... }
fn read_u16(&mut self) -> u16 { ... }
fn read_u32(&mut self) -> u32 { ... }
fn read_u64(&mut self) -> u64 { ... }
fn read_u128(&mut self) -> u128 { ... }
fn read_i8(&mut self) -> i8 { ... }
fn read_i16(&mut self) -> i16 { ... }
fn read_i32(&mut self) -> i32 { ... }
fn read_i64(&mut self) -> i64 { ... }
fn read_i128(&mut self) -> i128 { ... }
fn read_f32(&mut self) -> f32 { ... }
fn read_f64(&mut self) -> f64 { ... }
fn read_le_u8(&mut self) -> u8 { ... }
fn read_le_u16(&mut self) -> u16 { ... }
fn read_le_u32(&mut self) -> u32 { ... }
fn read_le_u64(&mut self) -> u64 { ... }
fn read_le_u128(&mut self) -> u128 { ... }
fn read_le_i8(&mut self) -> i8 { ... }
fn read_le_i16(&mut self) -> i16 { ... }
fn read_le_i32(&mut self) -> i32 { ... }
fn read_le_i64(&mut self) -> i64 { ... }
fn read_le_i128(&mut self) -> i128 { ... }
fn read_le_f32(&mut self) -> f32 { ... }
fn read_le_f64(&mut self) -> f64 { ... }
}
Expand description

Read bytes or numbers.

Required methods

Returns the entire slice.

Returns all remaining bytes.

Reads a given length of bytes.

Panics

If len exceeds self.remaining().len().

Tries to read a given length without updating the internal position. Returns None if there are not enought bytes remaining.

Provided methods

Returns the length of the entire slice.

Reads 1 bytes in big-endian converting them into an u8.

Panics

If there aren’t enough bytes left.

Reads 2 bytes in big-endian converting them into an u16.

Panics

If there aren’t enough bytes left.

Reads 4 bytes in big-endian converting them into an u32.

Panics

If there aren’t enough bytes left.

Reads 8 bytes in big-endian converting them into an u64.

Panics

If there aren’t enough bytes left.

Reads 16 bytes in big-endian converting them into an u128.

Panics

If there aren’t enough bytes left.

Reads 1 bytes in big-endian converting them into an i8.

Panics

If there aren’t enough bytes left.

Reads 2 bytes in big-endian converting them into an i16.

Panics

If there aren’t enough bytes left.

Reads 4 bytes in big-endian converting them into an i32.

Panics

If there aren’t enough bytes left.

Reads 8 bytes in big-endian converting them into an i64.

Panics

If there aren’t enough bytes left.

Reads 16 bytes in big-endian converting them into an i128.

Panics

If there aren’t enough bytes left.

Reads 4 bytes in big-endian converting them into an f32.

Panics

If there aren’t enough bytes left.

Reads 8 bytes in big-endian converting them into an f64.

Panics

If there aren’t enough bytes left.

Reads 1 bytes in little-endian converting them into an u8.

Panics

If there aren’t enough bytes left.

Reads 2 bytes in little-endian converting them into an u16.

Panics

If there aren’t enough bytes left.

Reads 4 bytes in little-endian converting them into an u32.

Panics

If there aren’t enough bytes left.

Reads 8 bytes in little-endian converting them into an u64.

Panics

If there aren’t enough bytes left.

Reads 16 bytes in little-endian converting them into an u128.

Panics

If there aren’t enough bytes left.

Reads 1 bytes in little-endian converting them into an i8.

Panics

If there aren’t enough bytes left.

Reads 2 bytes in little-endian converting them into an i16.

Panics

If there aren’t enough bytes left.

Reads 4 bytes in little-endian converting them into an i32.

Panics

If there aren’t enough bytes left.

Reads 8 bytes in little-endian converting them into an i64.

Panics

If there aren’t enough bytes left.

Reads 16 bytes in little-endian converting them into an i128.

Panics

If there aren’t enough bytes left.

Reads 4 bytes in little-endian converting them into an f32.

Panics

If there aren’t enough bytes left.

Reads 8 bytes in little-endian converting them into an f64.

Panics

If there aren’t enough bytes left.

Implementors