Struct binary_stream::BinaryReader
source · [−]pub struct BinaryReader<'a> { /* private fields */ }Expand description
Read from a stream.
Implementations
sourceimpl<'a> BinaryReader<'a>
impl<'a> BinaryReader<'a>
sourcepub fn new(stream: &'a mut impl ReadStream, endian: Endian) -> Self
pub fn new(stream: &'a mut impl ReadStream, endian: Endian) -> Self
Create a binary reader with the given endianness.
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>
pub fn read_isize(&mut self) -> Result<isize>
Read an isize from the stream.
sourcepub fn read_usize(&mut self) -> Result<usize>
pub fn read_usize(&mut self) -> Result<usize>
Read a usize from the stream.
Trait Implementations
Auto Trait Implementations
impl<'a> !RefUnwindSafe for BinaryReader<'a>
impl<'a> !Send for BinaryReader<'a>
impl<'a> !Sync for BinaryReader<'a>
impl<'a> Unpin for BinaryReader<'a>
impl<'a> !UnwindSafe for BinaryReader<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more