pub struct Parser<T>where
T: UnderlyingBuffer,{ /* private fields */ }
Expand description
Streaming parser for UBX protocol with buffer. The default constructor will build a parser containing a Vec, but you can pass your own underlying buffer by passing it to Parser::new().
If you pass your own buffer, it should be able to store at least 4 bytes. In practice, you won’t be able to do anything useful unless it’s at least 36 bytes long (the size of a NavPosLlh packet).
Implementations§
source§impl<T: UnderlyingBuffer> Parser<T>
impl<T: UnderlyingBuffer> Parser<T>
pub fn new(underlying: T) -> Self
pub fn is_buffer_empty(&self) -> bool
pub fn buffer_len(&self) -> usize
pub fn consume<'a>(&'a mut self, new_data: &'a [u8]) -> ParserIter<'a, T>
Trait Implementations§
Auto Trait Implementations§
impl<T> RefUnwindSafe for Parser<T>where T: RefUnwindSafe,
impl<T> Send for Parser<T>where T: Send,
impl<T> Sync for Parser<T>where T: Sync,
impl<T> Unpin for Parser<T>where T: Unpin,
impl<T> UnwindSafe for Parser<T>where T: 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