pub trait ReadValAt: Read + Seek {
Show 62 methods
// Provided methods
fn read_u8_at(&mut self, pos: usize) -> Result<u8> { ... }
fn read_u16_at(&mut self, pos: usize, endianess: Endianess) -> Result<u16> { ... }
fn read_u32_at(&mut self, pos: usize, endianess: Endianess) -> Result<u32> { ... }
fn read_u64_at(&mut self, pos: usize, endianess: Endianess) -> Result<u64> { ... }
fn read_u128_at(&mut self, pos: usize, endianess: Endianess) -> Result<u128> { ... }
fn read_usize_at(
&mut self,
pos: usize,
endianess: Endianess,
) -> Result<usize> { ... }
fn read_i8_at(&mut self, pos: usize) -> Result<i8> { ... }
fn read_i16_at(&mut self, pos: usize, endianess: Endianess) -> Result<i16> { ... }
fn read_i32_at(&mut self, pos: usize, endianess: Endianess) -> Result<i32> { ... }
fn read_i64_at(&mut self, pos: usize, endianess: Endianess) -> Result<i64> { ... }
fn read_i128_at(&mut self, pos: usize, endianess: Endianess) -> Result<i128> { ... }
fn read_isize_at(
&mut self,
pos: usize,
endianess: Endianess,
) -> Result<isize> { ... }
fn read_f32_at(&mut self, pos: usize, endianess: Endianess) -> Result<f32> { ... }
fn read_f64_at(&mut self, pos: usize, endianess: Endianess) -> Result<f64> { ... }
fn read_u8_array_at<const S: usize>(
&mut self,
pos: usize,
) -> Result<[u8; S]> { ... }
fn read_bool_at(&mut self, pos: usize) -> Result<bool> { ... }
fn read_vec_at(&mut self, pos: usize, len: usize) -> Result<Vec<u8>> { ... }
fn read_str_at(&mut self, pos: usize, len: usize) -> Result<String> { ... }
fn read_ne_at<T: Primitive<U, S>, U, const S: usize>(
&mut self,
pos: usize,
) -> Result<T> { ... }
fn read_le_at<T: Primitive<U, S>, U, const S: usize>(
&mut self,
pos: usize,
) -> Result<T> { ... }
fn read_be_at<T: Primitive<U, S>, U, const S: usize>(
&mut self,
pos: usize,
) -> Result<T> { ... }
fn read_u16_ne_at(&mut self, pos: usize) -> Result<u16> { ... }
fn read_u16_le_at(&mut self, pos: usize) -> Result<u16> { ... }
fn read_u16_be_at(&mut self, pos: usize) -> Result<u16> { ... }
fn read_u32_ne_at(&mut self, pos: usize) -> Result<u32> { ... }
fn read_u32_le_at(&mut self, pos: usize) -> Result<u32> { ... }
fn read_u32_be_at(&mut self, pos: usize) -> Result<u32> { ... }
fn read_u64_ne_at(&mut self, pos: usize) -> Result<u64> { ... }
fn read_u64_le_at(&mut self, pos: usize) -> Result<u64> { ... }
fn read_u64_be_at(&mut self, pos: usize) -> Result<u64> { ... }
fn read_u128_ne_at(&mut self, pos: usize) -> Result<u128> { ... }
fn read_u128_le_at(&mut self, pos: usize) -> Result<u128> { ... }
fn read_u128_be_at(&mut self, pos: usize) -> Result<u128> { ... }
fn read_usize_ne_at(&mut self, pos: usize) -> Result<usize> { ... }
fn read_usize_le_at(&mut self, pos: usize) -> Result<usize> { ... }
fn read_usize_be_at(&mut self, pos: usize) -> Result<usize> { ... }
fn read_i16_ne_at(&mut self, pos: usize) -> Result<i16> { ... }
fn read_i16_le_at(&mut self, pos: usize) -> Result<i16> { ... }
fn read_i16_be_at(&mut self, pos: usize) -> Result<i16> { ... }
fn read_i32_ne_at(&mut self, pos: usize) -> Result<i32> { ... }
fn read_i32_le_at(&mut self, pos: usize) -> Result<i32> { ... }
fn read_i32_be_at(&mut self, pos: usize) -> Result<i32> { ... }
fn read_i64_ne_at(&mut self, pos: usize) -> Result<i64> { ... }
fn read_i64_le_at(&mut self, pos: usize) -> Result<i64> { ... }
fn read_i64_be_at(&mut self, pos: usize) -> Result<i64> { ... }
fn read_i128_ne_at(&mut self, pos: usize) -> Result<i128> { ... }
fn read_i128_le_at(&mut self, pos: usize) -> Result<i128> { ... }
fn read_i128_be_at(&mut self, pos: usize) -> Result<i128> { ... }
fn read_isize_ne_at(&mut self, pos: usize) -> Result<isize> { ... }
fn read_isize_le_at(&mut self, pos: usize) -> Result<isize> { ... }
fn read_isize_be_at(&mut self, pos: usize) -> Result<isize> { ... }
fn read_f32_ne_at(&mut self, pos: usize) -> Result<f32> { ... }
fn read_f32_le_at(&mut self, pos: usize) -> Result<f32> { ... }
fn read_f32_be_at(&mut self, pos: usize) -> Result<f32> { ... }
fn read_f64_ne_at(&mut self, pos: usize) -> Result<f64> { ... }
fn read_f64_le_at(&mut self, pos: usize) -> Result<f64> { ... }
fn read_f64_be_at(&mut self, pos: usize) -> Result<f64> { ... }
fn read_dynamic_at<T: Dynamic>(&mut self, len: usize) -> Result<T> { ... }
fn copy_at(
&mut self,
srcpos: usize,
len: usize,
target: &mut dyn Write,
) -> Result<()> { ... }
fn copy_to_at(
&mut self,
srcpos: usize,
len: usize,
targetpos: usize,
target: &mut dyn WriteSeek,
) -> Result<()> { ... }
fn copy_chunked_at(
&mut self,
srcpos: usize,
len: usize,
target: &mut dyn Write,
chunk_size: usize,
) -> Result<()> { ... }
fn copy_chunked_to_at(
&mut self,
srcpos: usize,
len: usize,
targetpos: usize,
target: &mut dyn WriteSeek,
chunk_size: usize,
) -> Result<()> { ... }
}
Expand description
Extension trait for Read + Seek
that provides methods for reading supported value types.
Note: do not borrow this as &mut dyn ReadValAt
, as this would not compile. Use &mut dyn dh::ReadSeek
instead.
Provided Methods§
Sourcefn read_u8_at(&mut self, pos: usize) -> Result<u8>
fn read_u8_at(&mut self, pos: usize) -> Result<u8>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u16_at(&mut self, pos: usize, endianess: Endianess) -> Result<u16>
fn read_u16_at(&mut self, pos: usize, endianess: Endianess) -> Result<u16>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u32_at(&mut self, pos: usize, endianess: Endianess) -> Result<u32>
fn read_u32_at(&mut self, pos: usize, endianess: Endianess) -> Result<u32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u64_at(&mut self, pos: usize, endianess: Endianess) -> Result<u64>
fn read_u64_at(&mut self, pos: usize, endianess: Endianess) -> Result<u64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u128_at(&mut self, pos: usize, endianess: Endianess) -> Result<u128>
fn read_u128_at(&mut self, pos: usize, endianess: Endianess) -> Result<u128>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_usize_at(&mut self, pos: usize, endianess: Endianess) -> Result<usize>
fn read_usize_at(&mut self, pos: usize, endianess: Endianess) -> Result<usize>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i8_at(&mut self, pos: usize) -> Result<i8>
fn read_i8_at(&mut self, pos: usize) -> Result<i8>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i16_at(&mut self, pos: usize, endianess: Endianess) -> Result<i16>
fn read_i16_at(&mut self, pos: usize, endianess: Endianess) -> Result<i16>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i32_at(&mut self, pos: usize, endianess: Endianess) -> Result<i32>
fn read_i32_at(&mut self, pos: usize, endianess: Endianess) -> Result<i32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i64_at(&mut self, pos: usize, endianess: Endianess) -> Result<i64>
fn read_i64_at(&mut self, pos: usize, endianess: Endianess) -> Result<i64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i128_at(&mut self, pos: usize, endianess: Endianess) -> Result<i128>
fn read_i128_at(&mut self, pos: usize, endianess: Endianess) -> Result<i128>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_isize_at(&mut self, pos: usize, endianess: Endianess) -> Result<isize>
fn read_isize_at(&mut self, pos: usize, endianess: Endianess) -> Result<isize>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_f32_at(&mut self, pos: usize, endianess: Endianess) -> Result<f32>
fn read_f32_at(&mut self, pos: usize, endianess: Endianess) -> Result<f32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_f64_at(&mut self, pos: usize, endianess: Endianess) -> Result<f64>
fn read_f64_at(&mut self, pos: usize, endianess: Endianess) -> Result<f64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u8_array_at<const S: usize>(&mut self, pos: usize) -> Result<[u8; S]>
fn read_u8_array_at<const S: usize>(&mut self, pos: usize) -> Result<[u8; S]>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_bool_at(&mut self, pos: usize) -> Result<bool>
fn read_bool_at(&mut self, pos: usize) -> Result<bool>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_vec_at(&mut self, pos: usize, len: usize) -> Result<Vec<u8>>
fn read_vec_at(&mut self, pos: usize, len: usize) -> Result<Vec<u8>>
Typed wrapper around read_dynamic_at
.
Sourcefn read_str_at(&mut self, pos: usize, len: usize) -> Result<String>
fn read_str_at(&mut self, pos: usize, len: usize) -> Result<String>
Typed wrapper around read_dynamic_at
.
Sourcefn read_ne_at<T: Primitive<U, S>, U, const S: usize>(
&mut self,
pos: usize,
) -> Result<T>
fn read_ne_at<T: Primitive<U, S>, U, const S: usize>( &mut self, pos: usize, ) -> Result<T>
Reads a primitive value from the reader using the specified byte order.
It’s recommended to use the typed wrappers like read_u8_at
instead of this method for cleaner code.
Sourcefn read_le_at<T: Primitive<U, S>, U, const S: usize>(
&mut self,
pos: usize,
) -> Result<T>
fn read_le_at<T: Primitive<U, S>, U, const S: usize>( &mut self, pos: usize, ) -> Result<T>
Reads a primitive value from the reader using the specified byte order.
It’s recommended to use the typed wrappers like read_u8_at
instead of this method for cleaner code.
Sourcefn read_be_at<T: Primitive<U, S>, U, const S: usize>(
&mut self,
pos: usize,
) -> Result<T>
fn read_be_at<T: Primitive<U, S>, U, const S: usize>( &mut self, pos: usize, ) -> Result<T>
Reads a primitive value from the reader using the specified byte order.
It’s recommended to use the typed wrappers like read_u8_at
instead of this method for cleaner code.
Sourcefn read_u16_ne_at(&mut self, pos: usize) -> Result<u16>
fn read_u16_ne_at(&mut self, pos: usize) -> Result<u16>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u16_le_at(&mut self, pos: usize) -> Result<u16>
fn read_u16_le_at(&mut self, pos: usize) -> Result<u16>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u16_be_at(&mut self, pos: usize) -> Result<u16>
fn read_u16_be_at(&mut self, pos: usize) -> Result<u16>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u32_ne_at(&mut self, pos: usize) -> Result<u32>
fn read_u32_ne_at(&mut self, pos: usize) -> Result<u32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u32_le_at(&mut self, pos: usize) -> Result<u32>
fn read_u32_le_at(&mut self, pos: usize) -> Result<u32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u32_be_at(&mut self, pos: usize) -> Result<u32>
fn read_u32_be_at(&mut self, pos: usize) -> Result<u32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u64_ne_at(&mut self, pos: usize) -> Result<u64>
fn read_u64_ne_at(&mut self, pos: usize) -> Result<u64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u64_le_at(&mut self, pos: usize) -> Result<u64>
fn read_u64_le_at(&mut self, pos: usize) -> Result<u64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u64_be_at(&mut self, pos: usize) -> Result<u64>
fn read_u64_be_at(&mut self, pos: usize) -> Result<u64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u128_ne_at(&mut self, pos: usize) -> Result<u128>
fn read_u128_ne_at(&mut self, pos: usize) -> Result<u128>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u128_le_at(&mut self, pos: usize) -> Result<u128>
fn read_u128_le_at(&mut self, pos: usize) -> Result<u128>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_u128_be_at(&mut self, pos: usize) -> Result<u128>
fn read_u128_be_at(&mut self, pos: usize) -> Result<u128>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_usize_ne_at(&mut self, pos: usize) -> Result<usize>
fn read_usize_ne_at(&mut self, pos: usize) -> Result<usize>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_usize_le_at(&mut self, pos: usize) -> Result<usize>
fn read_usize_le_at(&mut self, pos: usize) -> Result<usize>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_usize_be_at(&mut self, pos: usize) -> Result<usize>
fn read_usize_be_at(&mut self, pos: usize) -> Result<usize>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i16_ne_at(&mut self, pos: usize) -> Result<i16>
fn read_i16_ne_at(&mut self, pos: usize) -> Result<i16>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i16_le_at(&mut self, pos: usize) -> Result<i16>
fn read_i16_le_at(&mut self, pos: usize) -> Result<i16>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i16_be_at(&mut self, pos: usize) -> Result<i16>
fn read_i16_be_at(&mut self, pos: usize) -> Result<i16>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i32_ne_at(&mut self, pos: usize) -> Result<i32>
fn read_i32_ne_at(&mut self, pos: usize) -> Result<i32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i32_le_at(&mut self, pos: usize) -> Result<i32>
fn read_i32_le_at(&mut self, pos: usize) -> Result<i32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i32_be_at(&mut self, pos: usize) -> Result<i32>
fn read_i32_be_at(&mut self, pos: usize) -> Result<i32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i64_ne_at(&mut self, pos: usize) -> Result<i64>
fn read_i64_ne_at(&mut self, pos: usize) -> Result<i64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i64_le_at(&mut self, pos: usize) -> Result<i64>
fn read_i64_le_at(&mut self, pos: usize) -> Result<i64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i64_be_at(&mut self, pos: usize) -> Result<i64>
fn read_i64_be_at(&mut self, pos: usize) -> Result<i64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i128_ne_at(&mut self, pos: usize) -> Result<i128>
fn read_i128_ne_at(&mut self, pos: usize) -> Result<i128>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i128_le_at(&mut self, pos: usize) -> Result<i128>
fn read_i128_le_at(&mut self, pos: usize) -> Result<i128>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_i128_be_at(&mut self, pos: usize) -> Result<i128>
fn read_i128_be_at(&mut self, pos: usize) -> Result<i128>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_isize_ne_at(&mut self, pos: usize) -> Result<isize>
fn read_isize_ne_at(&mut self, pos: usize) -> Result<isize>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_isize_le_at(&mut self, pos: usize) -> Result<isize>
fn read_isize_le_at(&mut self, pos: usize) -> Result<isize>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_isize_be_at(&mut self, pos: usize) -> Result<isize>
fn read_isize_be_at(&mut self, pos: usize) -> Result<isize>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_f32_ne_at(&mut self, pos: usize) -> Result<f32>
fn read_f32_ne_at(&mut self, pos: usize) -> Result<f32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_f32_le_at(&mut self, pos: usize) -> Result<f32>
fn read_f32_le_at(&mut self, pos: usize) -> Result<f32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_f32_be_at(&mut self, pos: usize) -> Result<f32>
fn read_f32_be_at(&mut self, pos: usize) -> Result<f32>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_f64_ne_at(&mut self, pos: usize) -> Result<f64>
fn read_f64_ne_at(&mut self, pos: usize) -> Result<f64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_f64_le_at(&mut self, pos: usize) -> Result<f64>
fn read_f64_le_at(&mut self, pos: usize) -> Result<f64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_f64_be_at(&mut self, pos: usize) -> Result<f64>
fn read_f64_be_at(&mut self, pos: usize) -> Result<f64>
Typed wrapper around read_ne_at
, read_le_at
, or read_be_at
.
Sourcefn read_dynamic_at<T: Dynamic>(&mut self, len: usize) -> Result<T>
fn read_dynamic_at<T: Dynamic>(&mut self, len: usize) -> Result<T>
Reads a dynamic value from the reader.
It’s recommended to use the typed wrappers like read_vec_at
instead of this method for cleaner code.
fn copy_at( &mut self, srcpos: usize, len: usize, target: &mut dyn Write, ) -> Result<()>
fn copy_to_at( &mut self, srcpos: usize, len: usize, targetpos: usize, target: &mut dyn WriteSeek, ) -> Result<()>
fn copy_chunked_at( &mut self, srcpos: usize, len: usize, target: &mut dyn Write, chunk_size: usize, ) -> Result<()>
fn copy_chunked_to_at( &mut self, srcpos: usize, len: usize, targetpos: usize, target: &mut dyn WriteSeek, chunk_size: usize, ) -> Result<()>
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.