pub struct UserDefinedPacket<'a> {
pub control_type: u16,
pub subtype: u16,
pub type_specific_info: u32,
pub timestamp: u32,
pub dest_socket_id: u32,
pub cif: &'a [u8],
}Expand description
A Control Type = User-Defined (0x7FFF) packet, or a Control Type not
defined by Table 1. The CIF is genuinely opaque here — the only defined
use is the Key Material message (§3.2.2) via Subtype
SRT_CMD_KMREQ/SRT_CMD_KMRSP — see Self::as_key_material.
Fields§
§control_type: u16The raw 15-bit Control Type value.
subtype: u16The 16-bit Subtype — SRT_CMD_KMREQ/SRT_CMD_KMRSP when the CIF is
Key Material (Table 5), otherwise vendor-defined.
type_specific_info: u32The header Type-specific Information word.
timestamp: u32Timestamp (§3).
dest_socket_id: u32Destination Socket ID (§3).
cif: &'a [u8]The raw CIF bytes.
Implementations§
Source§impl<'a> UserDefinedPacket<'a>
impl<'a> UserDefinedPacket<'a>
Sourcepub fn as_key_material(&self) -> Result<KeyMaterial<'a>>
pub fn as_key_material(&self) -> Result<KeyMaterial<'a>>
Attempt to decode Self::cif as a Key Material message (§3.2.2).
Valid regardless of Self::subtype — callers that care should check
subtype against SRT_CMD_KMREQ/SRT_CMD_KMRSP (Table 5) first.
Trait Implementations§
Source§impl<'a> Clone for UserDefinedPacket<'a>
impl<'a> Clone for UserDefinedPacket<'a>
Source§fn clone(&self) -> UserDefinedPacket<'a>
fn clone(&self) -> UserDefinedPacket<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 UserDefinedPacket<'a>
impl<'a> Debug for UserDefinedPacket<'a>
Source§impl<'a> PartialEq for UserDefinedPacket<'a>
impl<'a> PartialEq for UserDefinedPacket<'a>
Source§fn eq(&self, other: &UserDefinedPacket<'a>) -> bool
fn eq(&self, other: &UserDefinedPacket<'a>) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl<'a> Serialize for UserDefinedPacket<'a>
impl<'a> Serialize for UserDefinedPacket<'a>
impl<'a> StructuralPartialEq for UserDefinedPacket<'a>
Auto Trait Implementations§
impl<'a> Freeze for UserDefinedPacket<'a>
impl<'a> RefUnwindSafe for UserDefinedPacket<'a>
impl<'a> Send for UserDefinedPacket<'a>
impl<'a> Sync for UserDefinedPacket<'a>
impl<'a> Unpin for UserDefinedPacket<'a>
impl<'a> UnsafeUnpin for UserDefinedPacket<'a>
impl<'a> UnwindSafe for UserDefinedPacket<'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