pub struct ParserMut<'a> {
pub bytes: &'a mut [u8],
}
Expand description
A parser that can return mutable references to the data that it parses.
Most of the methods defined on ParserMut
are equivalent to the same methods on Parser
.
Fields§
§bytes: &'a mut [u8]
The remaining, unparsed data.
Implementations§
Source§impl<'a> ParserMut<'a>
impl<'a> ParserMut<'a>
pub fn new(bytes: &'a mut [u8]) -> Self
pub fn peek_rest(&self) -> &[u8] ⓘ
pub fn peek_rest_mut(&mut self) -> &mut [u8] ⓘ
pub fn into_rest(self) -> &'a mut [u8] ⓘ
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
pub fn skip(&mut self, n: usize) -> Result<(), ParserError>
pub fn bytes(&mut self, n: usize) -> Result<&'a [u8], ParserError>
pub fn bytes_mut(&mut self, n: usize) -> Result<&'a mut [u8], ParserError>
pub fn get<T: FromBytes + Unaligned + Immutable + KnownLayout>( &mut self, ) -> Result<&'a T, ParserError>
pub fn get_mut<T: FromBytes + IntoBytes + Unaligned + Immutable + KnownLayout>( &mut self, ) -> Result<&'a mut T, ParserError>
pub fn copy<T: FromBytes + Unaligned + Immutable>( &mut self, ) -> Result<T, ParserError>
pub fn slice_mut<T: FromBytes + IntoBytes + Unaligned>( &mut self, len: usize, ) -> Result<&'a mut [T], ParserError>
pub fn array<const N: usize>(&mut self) -> Result<[u8; N], ParserError>
pub fn u8(&mut self) -> Result<u8, ParserError>
pub fn i8(&mut self) -> Result<i8, ParserError>
pub fn i16(&mut self) -> Result<i16, ParserError>
pub fn i32(&mut self) -> Result<i32, ParserError>
pub fn i64(&mut self) -> Result<i64, ParserError>
pub fn u16(&mut self) -> Result<u16, ParserError>
pub fn u32(&mut self) -> Result<u32, ParserError>
pub fn u64(&mut self) -> Result<u64, ParserError>
pub fn skip_strz(&mut self) -> Result<(), ParserError>
pub fn strz(&mut self) -> Result<&'a mut BStr, ParserError>
pub fn type_index(&mut self) -> Result<TypeIndex, ParserError>
pub fn skip_number(&mut self) -> Result<(), ParserError>
Auto Trait Implementations§
impl<'a> Freeze for ParserMut<'a>
impl<'a> RefUnwindSafe for ParserMut<'a>
impl<'a> Send for ParserMut<'a>
impl<'a> Sync for ParserMut<'a>
impl<'a> Unpin for ParserMut<'a>
impl<'a> !UnwindSafe for ParserMut<'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