pub struct BinaryReader<'a> { /* private fields */ }Expand description
Read from a stream.
Implementations§
Source§impl<'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_7bit_encoded_len_string(&mut self) -> Result<String>
pub fn read_7bit_encoded_len_string(&mut self) -> Result<String>
Read a 7bit encoded length-prefixed String from the stream.
Sourcepub fn swap_endianness(&mut self)
pub fn swap_endianness(&mut self)
Swap endianness to allow for reversing the reading mid 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.
Sourcepub fn read_7bit_encoded_i32(&mut self) -> Result<i32>
pub fn read_7bit_encoded_i32(&mut self) -> Result<i32>
Read 7bit encoded i32 from the stream
Sourcepub fn read_7bit_encoded_usize(&mut self) -> Result<usize>
pub fn read_7bit_encoded_usize(&mut self) -> Result<usize>
Read 7bit encoded usize from the stream
Sourcepub fn read_7bit_encoded_u32(&mut self) -> Result<u32>
pub fn read_7bit_encoded_u32(&mut self) -> Result<u32>
Read 7bit encoded u32 from the stream
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for BinaryReader<'a>
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§
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