Struct binary_stream::BinaryReader
source · pub struct BinaryReader<R>{ /* private fields */ }
Expand description
Read from a stream.
Implementations§
source§impl<R: Read + Seek> BinaryReader<R>
impl<R: Read + Seek> BinaryReader<R>
sourcepub fn stream_position(&mut self) -> Result<u64>
pub fn stream_position(&mut self) -> Result<u64>
Get the current seek position.
sourcepub fn len(&mut self) -> Result<u64>
pub fn len(&mut self) -> Result<u64>
Get the length of this stream by seeking to the end and then restoring the previous cursor position.
sourcepub fn read_string(&mut self) -> Result<String>
pub fn read_string(&mut self) -> Result<String>
Read a length-prefixed String
from the stream.
sourcepub fn read_isize(&mut self) -> Result<isize>
Available on 32-bit only.
pub fn read_isize(&mut self) -> Result<isize>
Read an isize
from the stream.
sourcepub fn read_usize(&mut self) -> Result<usize>
Available on 32-bit only.
pub fn read_usize(&mut self) -> Result<usize>
Read a usize
from the stream.
Auto Trait Implementations§
impl<R> RefUnwindSafe for BinaryReader<R>where
R: RefUnwindSafe,
impl<R> Send for BinaryReader<R>where
R: Send,
impl<R> Sync for BinaryReader<R>where
R: Sync,
impl<R> Unpin for BinaryReader<R>where
R: Unpin,
impl<R> UnwindSafe for BinaryReader<R>where
R: UnwindSafe,
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