pub struct PacketReader<'a> { /* private fields */ }Implementations§
Source§impl<'a> PacketReader<'a>
impl<'a> PacketReader<'a>
pub fn new(buffer: &'a [u8], size: u16) -> Self
pub fn position(&self) -> u16
pub fn remaining(&self) -> u16
pub fn can_read(&self, bytes: u16) -> bool
pub fn read_byte(&mut self) -> Result<u8>
pub fn read_u16(&mut self) -> Result<u16>
pub fn read_u32(&mut self) -> Result<u32>
pub fn read_bytes(&mut self, dest: &mut [u8]) -> Result<()>
pub fn skip(&mut self, count: u16) -> Result<()>
pub fn peek_byte(&self) -> Result<u8>
pub fn current_ptr(&self) -> &'a [u8] ⓘ
pub fn parse_coap_header(&mut self) -> Result<CoAPHeader>
pub fn skip_token(&mut self, token_length: u8) -> Result<()>
Sourcepub fn parse_coap_option(&mut self) -> Result<(u16, u16, &'a [u8])>
pub fn parse_coap_option(&mut self) -> Result<(u16, u16, &'a [u8])>
Parse a single CoAP option. Returns (delta, length, value_slice).
Sourcepub fn parse_signet_options(&mut self) -> Result<SigNetOptions>
pub fn parse_signet_options(&mut self) -> Result<SigNetOptions>
Parse all 6 SigNet options (2076–2236) from the current position. Stops at the payload marker (0xFF) — all options including HMAC must precede it. Leaves the reader positioned at the first byte of the payload.
pub fn parse_tlv_block(&mut self) -> Result<TLVBlock<'a>>
pub fn extract_uri_string(&mut self, uri_string: &mut [u8]) -> Result<usize>
Auto Trait Implementations§
impl<'a> Freeze for PacketReader<'a>
impl<'a> RefUnwindSafe for PacketReader<'a>
impl<'a> Send for PacketReader<'a>
impl<'a> Sync for PacketReader<'a>
impl<'a> Unpin for PacketReader<'a>
impl<'a> UnsafeUnpin for PacketReader<'a>
impl<'a> UnwindSafe for PacketReader<'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