pub struct Decoder { /* private fields */ }
Expand description
Decoder for the Advanced Navigation Packet Protocol.
Implementations§
Source§impl Decoder
impl Decoder
Sourcepub const DEFAULT_DECODER_BUFFER_SIZE: usize = 512usize
pub const DEFAULT_DECODER_BUFFER_SIZE: usize = 512usize
The buffer size used when not compiled with the std
feature flag.
Sourcepub fn bytes_in_buffer(&self) -> usize
pub fn bytes_in_buffer(&self) -> usize
How many bytes are in the Decoder
’s internal buffer?
Sourcepub fn remaining_capacity(&self) -> usize
pub fn remaining_capacity(&self) -> usize
The amount of data that can be added to the Decoder
’s internal buffer
before it will become full.
§Note
When compiled with the std
feature the buffer is considered
effectively infinite.
Sourcepub fn push_data(&mut self, data: &[u8]) -> Result<(), InsufficientCapacity>
pub fn push_data(&mut self, data: &[u8]) -> Result<(), InsufficientCapacity>
Try to add some more raw data to the Decoder
’s internal buffer.
Sourcepub fn decode(&mut self) -> Result<Packet, DecodeError>
pub fn decode(&mut self) -> Result<Packet, DecodeError>
Retrieve the next Packet
from the Decoder
’s internal buffer.
Trait Implementations§
impl StructuralPartialEq for Decoder
Auto Trait Implementations§
impl Freeze for Decoder
impl RefUnwindSafe for Decoder
impl Send for Decoder
impl Sync for Decoder
impl Unpin for Decoder
impl UnwindSafe for Decoder
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