Trait CPeek

Source
pub trait CPeek {
Show 46 methods // Required methods fn cpeek(&self, buf: &mut [u8]) -> Result<usize>; fn cpeek_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>; fn cpeek_cstring(&self) -> Result<CString>; // Provided methods fn cpeek_exact(&self, buf: &mut [u8]) -> Result<()> { ... } fn cpeek_exact_at(&self, offset: u64, buf: &mut [u8]) -> Result<()> { ... } fn cpeek_at_vec(&self, offset: u64, len: usize) -> Result<Vec<u8>> { ... } fn cpeek_exact_at_vec(&self, offset: u64, len: usize) -> Result<Vec<u8>> { ... } fn cpeek_u8(&self) -> Result<u8> { ... } fn cpeek_u16(&self) -> Result<u16> { ... } fn cpeek_u16_be(&self) -> Result<u16> { ... } fn cpeek_u32(&self) -> Result<u32> { ... } fn cpeek_u32_be(&self) -> Result<u32> { ... } fn cpeek_u64(&self) -> Result<u64> { ... } fn cpeek_u64_be(&self) -> Result<u64> { ... } fn cpeek_u128(&self) -> Result<u128> { ... } fn cpeek_u128_be(&self) -> Result<u128> { ... } fn cpeek_i8(&self) -> Result<i8> { ... } fn cpeek_i16(&self) -> Result<i16> { ... } fn cpeek_i16_be(&self) -> Result<i16> { ... } fn cpeek_i32(&self) -> Result<i32> { ... } fn cpeek_i32_be(&self) -> Result<i32> { ... } fn cpeek_i64(&self) -> Result<i64> { ... } fn cpeek_i64_be(&self) -> Result<i64> { ... } fn cpeek_i128(&self) -> Result<i128> { ... } fn cpeek_i128_be(&self) -> Result<i128> { ... } fn cpeek_u8_at(&self, offset: u64) -> Result<u8> { ... } fn cpeek_u16_at(&self, offset: u64) -> Result<u16> { ... } fn cpeek_u16_be_at(&self, offset: u64) -> Result<u16> { ... } fn cpeek_u32_at(&self, offset: u64) -> Result<u32> { ... } fn cpeek_u32_be_at(&self, offset: u64) -> Result<u32> { ... } fn cpeek_u64_at(&self, offset: u64) -> Result<u64> { ... } fn cpeek_u64_be_at(&self, offset: u64) -> Result<u64> { ... } fn cpeek_u128_at(&self, offset: u64) -> Result<u128> { ... } fn cpeek_u128_be_at(&self, offset: u64) -> Result<u128> { ... } fn cpeek_i8_at(&self, offset: u64) -> Result<i8> { ... } fn cpeek_i16_at(&self, offset: u64) -> Result<i16> { ... } fn cpeek_i16_be_at(&self, offset: u64) -> Result<i16> { ... } fn cpeek_i32_at(&self, offset: u64) -> Result<i32> { ... } fn cpeek_i32_be_at(&self, offset: u64) -> Result<i32> { ... } fn cpeek_i64_at(&self, offset: u64) -> Result<i64> { ... } fn cpeek_i64_be_at(&self, offset: u64) -> Result<i64> { ... } fn cpeek_i128_at(&self, offset: u64) -> Result<i128> { ... } fn cpeek_i128_be_at(&self, offset: u64) -> Result<i128> { ... } fn cpeek_cstring_at(&self, offset: u64) -> Result<CString> { ... } fn cpeek_and_equal(&self, data: &[u8]) -> Result<()> { ... } fn cpeek_and_equal_at(&self, offset: u64, data: &[u8]) -> Result<()> { ... }
}
Expand description

A trait to help to peek data from a reader in a thread-safe manner.

Required Methods§

Source

fn cpeek(&self, buf: &mut [u8]) -> Result<usize>

Peeks data from the reader into the provided buffer. Returns the number of bytes read.

Source

fn cpeek_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>

Peeks data from the reader at a specific offset into the provided buffer. Returns the number of bytes read.

Source

fn cpeek_cstring(&self) -> Result<CString>

Peeks a C-style string (null-terminated) from the reader.

Provided Methods§

Source

fn cpeek_exact(&self, buf: &mut [u8]) -> Result<()>

Peeks data from the reader into the provided buffer. Returns an error if the buffer is not filled completely.

Source

fn cpeek_exact_at(&self, offset: u64, buf: &mut [u8]) -> Result<()>

Peeks data from the reader at a specific offset into the provided buffer. Returns an error if the buffer is not filled completely.

Source

fn cpeek_at_vec(&self, offset: u64, len: usize) -> Result<Vec<u8>>

Peeks data from the reader at a specific offset into a vector. Returns the vector containing the data read.

Source

fn cpeek_exact_at_vec(&self, offset: u64, len: usize) -> Result<Vec<u8>>

Peeks data from the reader at a specific offset into a vector. Returns an error if the buffer is not filled completely.

Source

fn cpeek_u8(&self) -> Result<u8>

Peeks a u8 from the reader.

Source

fn cpeek_u16(&self) -> Result<u16>

Peeks a u16 from the reader in little-endian order.

Source

fn cpeek_u16_be(&self) -> Result<u16>

Peeks a u16 from the reader in big-endian order.

Source

fn cpeek_u32(&self) -> Result<u32>

Peeks a u32 from the reader in little-endian order.

Source

fn cpeek_u32_be(&self) -> Result<u32>

Peeks a u32 from the reader in big-endian order.

Source

fn cpeek_u64(&self) -> Result<u64>

Peeks a u64 from the reader in little-endian order.

Source

fn cpeek_u64_be(&self) -> Result<u64>

Peeks a u64 from the reader in big-endian order.

Source

fn cpeek_u128(&self) -> Result<u128>

Peeks a u128 from the reader in little-endian order.

Source

fn cpeek_u128_be(&self) -> Result<u128>

Peeks a u128 from the reader in big-endian order.

Source

fn cpeek_i8(&self) -> Result<i8>

Peeks an i8 from the reader.

Source

fn cpeek_i16(&self) -> Result<i16>

Peeks an i16 from the reader in little-endian order.

Source

fn cpeek_i16_be(&self) -> Result<i16>

Peeks an i16 from the reader in big-endian order.

Source

fn cpeek_i32(&self) -> Result<i32>

Peeks an i32 from the reader in little-endian order.

Source

fn cpeek_i32_be(&self) -> Result<i32>

Peeks an i32 from the reader in big-endian order.

Source

fn cpeek_i64(&self) -> Result<i64>

Peeks an i64 from the reader in little-endian order.

Source

fn cpeek_i64_be(&self) -> Result<i64>

Peeks an i64 from the reader in big-endian order.

Source

fn cpeek_i128(&self) -> Result<i128>

Peeks an i128 from the reader in little-endian order.

Source

fn cpeek_i128_be(&self) -> Result<i128>

Peeks an i128 from the reader in big-endian order.

Source

fn cpeek_u8_at(&self, offset: u64) -> Result<u8>

Peeks a u8 at a specific offset from the reader.

Source

fn cpeek_u16_at(&self, offset: u64) -> Result<u16>

Peeks a u16 at a specific offset from the reader in little-endian order.

Source

fn cpeek_u16_be_at(&self, offset: u64) -> Result<u16>

Peeks a u16 at a specific offset from the reader in big-endian order.

Source

fn cpeek_u32_at(&self, offset: u64) -> Result<u32>

Peeks a u32 at a specific offset from the reader in little-endian order.

Source

fn cpeek_u32_be_at(&self, offset: u64) -> Result<u32>

Peeks a u32 at a specific offset from the reader in big-endian order.

Source

fn cpeek_u64_at(&self, offset: u64) -> Result<u64>

Peeks a u64 at a specific offset from the reader in little-endian order.

Source

fn cpeek_u64_be_at(&self, offset: u64) -> Result<u64>

Peeks a u64 at a specific offset from the reader in big-endian order.

Source

fn cpeek_u128_at(&self, offset: u64) -> Result<u128>

Peeks a u128 at a specific offset from the reader in little-endian order.

Source

fn cpeek_u128_be_at(&self, offset: u64) -> Result<u128>

Peeks a u128 at a specific offset from the reader in big-endian order.

Source

fn cpeek_i8_at(&self, offset: u64) -> Result<i8>

Peeks an i8 at a specific offset from the reader.

Source

fn cpeek_i16_at(&self, offset: u64) -> Result<i16>

Peeks an i16 at a specific offset from the reader in little-endian order.

Source

fn cpeek_i16_be_at(&self, offset: u64) -> Result<i16>

Peeks an i16 at a specific offset from the reader in big-endian order.

Source

fn cpeek_i32_at(&self, offset: u64) -> Result<i32>

Peeks an i32 at a specific offset from the reader in little-endian order.

Source

fn cpeek_i32_be_at(&self, offset: u64) -> Result<i32>

Peeks an i32 at a specific offset from the reader in big-endian order.

Source

fn cpeek_i64_at(&self, offset: u64) -> Result<i64>

Peeks an i64 at a specific offset from the reader in little-endian order.

Source

fn cpeek_i64_be_at(&self, offset: u64) -> Result<i64>

Peeks an i64 at a specific offset from the reader in big-endian order.

Source

fn cpeek_i128_at(&self, offset: u64) -> Result<i128>

Peeks an i128 at a specific offset from the reader in little-endian order.

Source

fn cpeek_i128_be_at(&self, offset: u64) -> Result<i128>

Peeks an i128 at a specific offset from the reader in big-endian order.

Source

fn cpeek_cstring_at(&self, offset: u64) -> Result<CString>

Peeks a C-style string (null-terminated) from the reader at a specific offset.

Source

fn cpeek_and_equal(&self, data: &[u8]) -> Result<()>

Peeks data and checks if it matches the provided data.

Source

fn cpeek_and_equal_at(&self, offset: u64, data: &[u8]) -> Result<()>

Peeks data at a specific offset and checks if it matches the provided data.

Implementations on Foreign Types§

Source§

impl<T: Peek> CPeek for Mutex<T>

Source§

fn cpeek(&self, buf: &mut [u8]) -> Result<usize>

Source§

fn cpeek_at(&self, offset: u64, buf: &mut [u8]) -> Result<usize>

Source§

fn cpeek_cstring(&self) -> Result<CString>

Implementors§