struct Parser<'a> {
bytes: &'a [u8],
endianness: Endianness,
}
Expand description
Parser for the incoming byte stream.
Fields§
§bytes: &'a [u8]
§endianness: Endianness
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcefn new(bytes: &'a [u8]) -> Result<Self, ParserError>
fn new(bytes: &'a [u8]) -> Result<Self, ParserError>
Create a new parser.
Sourcefn i8(&mut self) -> Result<i8, ParserError>
fn i8(&mut self) -> Result<i8, ParserError>
Get a single byte.
Sourcefn i16(&mut self) -> Result<i16, ParserError>
fn i16(&mut self) -> Result<i16, ParserError>
Get two bytes.
Sourcefn i32(&mut self) -> Result<i32, ParserError>
fn i32(&mut self) -> Result<i32, ParserError>
Get four bytes.
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.