pub struct BinaryReader<R: Read, F: BinaryFormat> { /* private fields */ }Expand description
Generic binary reader with position tracking.
Implementations§
Source§impl<R: Read, F: BinaryFormat> BinaryReader<R, F>
impl<R: Read, F: BinaryFormat> BinaryReader<R, F>
Sourcepub fn get_position(&self) -> u64
pub fn get_position(&self) -> u64
Get current position (alias for position).
Sourcepub fn set_position(&mut self, pos: u64) -> Result<u64>where
R: Seek,
pub fn set_position(&mut self, pos: u64) -> Result<u64>where
R: Seek,
Set current position (alias for seek).
Sourcepub fn stream_position(&mut self) -> Result<u64>where
R: Seek,
pub fn stream_position(&mut self) -> Result<u64>where
R: Seek,
Get stream position.
Sourcepub fn take_errors(&mut self) -> Vec<GaiaError>
pub fn take_errors(&mut self) -> Vec<GaiaError>
Take all collected diagnostic errors.
Sourcepub fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
pub fn read_exact(&mut self, buf: &mut [u8]) -> Result<()>
Read into a buffer.
Trait Implementations§
Source§impl<R: Read + Debug, F: BinaryFormat> Debug for BinaryReader<R, F>
impl<R: Read + Debug, F: BinaryFormat> Debug for BinaryReader<R, F>
Source§impl<R: Read + Seek, F: BinaryFormat> Seek for BinaryReader<R, F>
impl<R: Read + Seek, F: BinaryFormat> Seek for BinaryReader<R, F>
Source§fn seek(&mut self, pos: SeekFrom) -> Result<u64>
fn seek(&mut self, pos: SeekFrom) -> Result<u64>
Seek to an offset, in bytes, in a stream. Read more
1.55.0 · Source§fn rewind(&mut self) -> Result<(), Error>
fn rewind(&mut self) -> Result<(), Error>
Rewind to the beginning of a stream. Read more
Source§fn stream_len(&mut self) -> Result<u64, Error>
fn stream_len(&mut self) -> Result<u64, Error>
🔬This is a nightly-only experimental API. (
seek_stream_len)Returns the length of this stream (in bytes). Read more
Auto Trait Implementations§
impl<R, F> Freeze for BinaryReader<R, F>where
R: Freeze,
impl<R, F> !RefUnwindSafe for BinaryReader<R, F>
impl<R, F> Send for BinaryReader<R, F>
impl<R, F> Sync for BinaryReader<R, F>
impl<R, F> Unpin for BinaryReader<R, F>
impl<R, F> UnsafeUnpin for BinaryReader<R, F>where
R: UnsafeUnpin,
impl<R, F> !UnwindSafe for BinaryReader<R, F>
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