Struct binary_rw::BinaryReader
source · 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