pub struct ParsedPacket<'a> {
pub addr: Address,
pub ctrl: ControlByte,
pub scb: Option<ScbView<'a>>,
pub code: u8,
pub data: &'a [u8],
pub mac: Option<[u8; 4]>,
pub trailer: Trailer,
}Expand description
View of a parsed OSDP packet, borrowed from the input slice.
The codec is zero-copy: payload, SCB data, and MAC slices all point into the input buffer.
Fields§
§addr: AddressSource/destination address (with reply flag if from PD).
ctrl: ControlByteDecoded CTRL byte.
scb: Option<ScbView<'a>>Security Control Block, if CTRL.HAS_SCB.
code: u8Command or reply code byte.
data: &'a [u8]Application data following the code byte (excluding any MAC trailer and the CRC/checksum).
mac: Option<[u8; 4]>4-byte MAC, if SCS_15..18.
trailer: TrailerTrailer kind.
Implementations§
Trait Implementations§
Source§impl<'a> Clone for ParsedPacket<'a>
impl<'a> Clone for ParsedPacket<'a>
Source§fn clone(&self) -> ParsedPacket<'a>
fn clone(&self) -> ParsedPacket<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for ParsedPacket<'a>
impl<'a> Debug for ParsedPacket<'a>
Source§impl<'a> PartialEq for ParsedPacket<'a>
impl<'a> PartialEq for ParsedPacket<'a>
impl<'a> Copy for ParsedPacket<'a>
impl<'a> Eq for ParsedPacket<'a>
impl<'a> StructuralPartialEq for ParsedPacket<'a>
Auto Trait Implementations§
impl<'a> Freeze for ParsedPacket<'a>
impl<'a> RefUnwindSafe for ParsedPacket<'a>
impl<'a> Send for ParsedPacket<'a>
impl<'a> Sync for ParsedPacket<'a>
impl<'a> Unpin for ParsedPacket<'a>
impl<'a> UnsafeUnpin for ParsedPacket<'a>
impl<'a> UnwindSafe for ParsedPacket<'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