pub struct BinaryReader { /* private fields */ }Expand description
Low-level binary data reader with position tracking
Implementations§
Source§impl BinaryReader
impl BinaryReader
Sourcepub fn seek(&mut self, pos: usize) -> ParserResult<()>
pub fn seek(&mut self, pos: usize) -> ParserResult<()>
Set position in the buffer
Sourcepub fn read_u8(&mut self) -> ParserResult<u8>
pub fn read_u8(&mut self) -> ParserResult<u8>
Read a single byte
Sourcepub fn peek_u8(&self) -> ParserResult<u8>
pub fn peek_u8(&self) -> ParserResult<u8>
Peek at the next byte without advancing
Sourcepub fn read_u16_le(&mut self) -> ParserResult<u16>
pub fn read_u16_le(&mut self) -> ParserResult<u16>
Read a 16-bit unsigned integer (little-endian)
Sourcepub fn read_u32_le(&mut self) -> ParserResult<u32>
pub fn read_u32_le(&mut self) -> ParserResult<u32>
Read a 32-bit unsigned integer (little-endian)
Sourcepub fn read_u64_le(&mut self) -> ParserResult<u64>
pub fn read_u64_le(&mut self) -> ParserResult<u64>
Read a 64-bit unsigned integer (little-endian)
Sourcepub fn read_f32_le(&mut self) -> ParserResult<f32>
pub fn read_f32_le(&mut self) -> ParserResult<f32>
Read a 32-bit float (little-endian)
Sourcepub fn read_f64_le(&mut self) -> ParserResult<f64>
pub fn read_f64_le(&mut self) -> ParserResult<f64>
Read a 64-bit float (little-endian)
Sourcepub fn read_string(&mut self, len: usize) -> ParserResult<String>
pub fn read_string(&mut self, len: usize) -> ParserResult<String>
Read a string of specific length
Sourcepub fn read_cstring(&mut self) -> ParserResult<String>
pub fn read_cstring(&mut self) -> ParserResult<String>
Read a null-terminated string
Sourcepub fn read_bytes(&mut self, count: usize) -> ParserResult<Vec<u8>>
pub fn read_bytes(&mut self, count: usize) -> ParserResult<Vec<u8>>
Read N bytes into a buffer
Auto Trait Implementations§
impl Freeze for BinaryReader
impl RefUnwindSafe for BinaryReader
impl Send for BinaryReader
impl Sync for BinaryReader
impl Unpin for BinaryReader
impl UnsafeUnpin for BinaryReader
impl UnwindSafe for BinaryReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more