pub trait ReadSlice<'a> {
Show 21 methods
// Required methods
fn read_u8(&mut self) -> Option<u8>;
fn read_u16<B: ByteOrder>(&mut self) -> Option<u16>;
fn read_u32<B: ByteOrder>(&mut self) -> Option<u32>;
fn read_u64<B: ByteOrder>(&mut self) -> Option<u64>;
fn read_u128<B: ByteOrder>(&mut self) -> Option<u128>;
fn read_uint32<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u32>;
fn read_uint64<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u64>;
fn read_uint128<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u128>;
fn read_i8(&mut self) -> Option<i8>;
fn read_i16<B: ByteOrder>(&mut self) -> Option<i16>;
fn read_i32<B: ByteOrder>(&mut self) -> Option<i32>;
fn read_i64<B: ByteOrder>(&mut self) -> Option<i64>;
fn read_i128<B: ByteOrder>(&mut self) -> Option<i128>;
fn read_int32<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i32>;
fn read_int64<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i64>;
fn read_int128<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i128>;
fn read_f32<B: ByteOrder>(&mut self) -> Option<f32>;
fn read_f64<B: ByteOrder>(&mut self) -> Option<f64>;
fn read_slice(&mut self, nb_bytes: usize) -> Option<&'a [u8]>;
fn read_slice_to_end(&mut self) -> &'a [u8] ⓘ;
fn move_forward(&mut self, nb_bytes: usize) -> Option<()>;
}Expand description
Extends &u8 with methods for reading numbers and slices
Required Methods§
Sourcefn read_uint32<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u32>
fn read_uint32<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u32>
Try to read an unsigned n-bytes integer from self
Sourcefn read_uint64<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u64>
fn read_uint64<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u64>
Try to read an unsigned n-bytes integer from self
Sourcefn read_uint128<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u128>
fn read_uint128<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<u128>
Try to read an unsigned n-bytes integer from self
Sourcefn read_int32<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i32>
fn read_int32<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i32>
Try to read a signed n-bytes integer from self
Sourcefn read_int64<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i64>
fn read_int64<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i64>
Try to read a signed n-bytes integer from self
Sourcefn read_int128<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i128>
fn read_int128<B: ByteOrder>(&mut self, nb_bytes: usize) -> Option<i128>
Try to read a signed n-bytes integer from self
Sourcefn read_slice(&mut self, nb_bytes: usize) -> Option<&'a [u8]>
fn read_slice(&mut self, nb_bytes: usize) -> Option<&'a [u8]>
Try to read a slice from self
Sourcefn read_slice_to_end(&mut self) -> &'a [u8] ⓘ
fn read_slice_to_end(&mut self) -> &'a [u8] ⓘ
Read a slice from start to end of self
Sourcefn move_forward(&mut self, nb_bytes: usize) -> Option<()>
fn move_forward(&mut self, nb_bytes: usize) -> Option<()>
Try to move forward in self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.