pub struct BspByteReader<'a> {
pub ctx: &'a BspParseContext,
/* private fields */
}Expand description
Like a Cursor, but i don’t have to constantly juggle buffers.
Fields§
§ctx: &'a BspParseContextImplementations§
Source§impl<'a> BspByteReader<'a>
impl<'a> BspByteReader<'a>
pub fn new(bytes: &'a [u8], ctx: &'a BspParseContext) -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn read<T: BspValue>(&mut self) -> BspResult<T>
Sourcepub fn read_rest(&mut self) -> &[u8] ⓘ
pub fn read_rest(&mut self) -> &[u8] ⓘ
Consume the rest of the reader, returning all remaining bytes.
pub fn read_bytes(&mut self, count: usize) -> BspResult<&[u8]>
pub fn with_pos(&self, pos: usize) -> Self
pub fn with_context(&'a self, ctx: &'a BspParseContext) -> Self
pub fn pos(&self) -> usize
Trait Implementations§
Source§impl<'a> Clone for BspByteReader<'a>
impl<'a> Clone for BspByteReader<'a>
Source§fn clone(&self) -> BspByteReader<'a>
fn clone(&self) -> BspByteReader<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> Freeze for BspByteReader<'a>
impl<'a> RefUnwindSafe for BspByteReader<'a>
impl<'a> Send for BspByteReader<'a>
impl<'a> Sync for BspByteReader<'a>
impl<'a> Unpin for BspByteReader<'a>
impl<'a> UnwindSafe for BspByteReader<'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