pub struct Bitreader<N: Readable> { /* private fields */ }Expand description
A little endian binary reader
Implementations§
Source§impl<N: Readable> Bitreader<N>
impl<N: Readable> Bitreader<N>
pub fn new(bits: N) -> Bitreader<N>
Sourcepub fn eof(&mut self) -> Result<bool, ParseError>
pub fn eof(&mut self) -> Result<bool, ParseError>
End Of File, returns true if not more bytes can be read
pub fn position(&self) -> u64
pub fn set_position(&mut self, position: u64)
pub fn read_bytes(&mut self, amount: usize) -> Result<Vec<u8>, ParseError>
pub fn read_string(&mut self, length: usize) -> Result<String, ParseError>
pub fn read_varuint(&mut self) -> Result<u32, ParseError>
pub fn read_bool(&mut self) -> Result<bool, ParseError>
pub fn read_f32(&mut self) -> Result<f32, ParseError>
pub fn read_f64(&mut self) -> Result<f64, ParseError>
pub fn read_u8(&mut self) -> Result<u8, ParseError>
pub fn read_u16(&mut self) -> Result<u16, ParseError>
pub fn read_u32(&mut self) -> Result<u32, ParseError>
Sourcepub fn read_uuid(&mut self) -> Result<String, ParseError>
pub fn read_uuid(&mut self) -> Result<String, ParseError>
Parse uuid from data in little endian format Using Variant 2 UUID’s with mixed endianess https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding
Auto Trait Implementations§
impl<N> Freeze for Bitreader<N>where
N: Freeze,
impl<N> RefUnwindSafe for Bitreader<N>where
N: RefUnwindSafe,
impl<N> Send for Bitreader<N>where
N: Send,
impl<N> Sync for Bitreader<N>where
N: Sync,
impl<N> Unpin for Bitreader<N>where
N: Unpin,
impl<N> UnwindSafe for Bitreader<N>where
N: 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