Skip to main content

NormData

Struct NormData 

Source
pub struct NormData<'a> {
    pub common: NormCommonHeader,
    pub sender: SenderWord,
    pub flags: u8,
    pub fec_id: u8,
    pub object_transport_id: u16,
    pub fec_payload_id: &'a [u8],
    pub extensions: Vec<HeaderExtension<'a>>,
    pub payload: &'a [u8],
}
Expand description

NORM_DATA fixed header beyond the common header + sender word (RFC 5740 §4.2.1, Figure 4): flags | fec_id | object_transport_id | fec_payload_id.

The fec_payload_id is opaque (size per fec_id). STREAM-only payload_len/payload_msg_start/payload_offset fields and the payload data are part of payload (they do not contribute to hdr_len); the caller interprets them when NORM_FLAG_STREAM is set.

Fields§

§common: NormCommonHeader

Common header.

§sender: SenderWord

Shared sender word.

§flags: u8

Object flags (NORM_FLAG_*).

§fec_id: u8

FEC Encoding ID (implies fec_payload_id size/format).

§object_transport_id: u16

Monotonic NormTransportId of the object.

§fec_payload_id: &'a [u8]

FEC coding-block + symbol identifier (opaque, size per fec_id).

§extensions: Vec<HeaderExtension<'a>>

Header-extension chain.

§payload: &'a [u8]

Source/parity content (and, for STREAM, the leading payload_* fields).

Implementations§

Source§

impl<'a> NormData<'a>

Source

pub fn serialized_len(&self) -> usize

Total serialized length in bytes.

Source

pub fn parse(data: &'a [u8], fec_payload_id_len: usize) -> Result<Self>

Parse a NORM_DATA. fec_payload_id_len is the FEC-scheme-defined size of the FEC Payload ID in bytes.

Source

pub fn serialize_into(&self, out: &mut [u8]) -> Result<usize>

Serialize into out, recomputing hdr_len. Returns bytes written.

Trait Implementations§

Source§

impl<'a> Clone for NormData<'a>

Source§

fn clone(&self) -> NormData<'a>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for NormData<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Eq for NormData<'a>

Source§

impl<'a> PartialEq for NormData<'a>

Source§

fn eq(&self, other: &NormData<'a>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<'a> Serialize for NormData<'a>

Available on crate feature serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a> StructuralPartialEq for NormData<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for NormData<'a>

§

impl<'a> RefUnwindSafe for NormData<'a>

§

impl<'a> Send for NormData<'a>

§

impl<'a> Sync for NormData<'a>

§

impl<'a> Unpin for NormData<'a>

§

impl<'a> UnsafeUnpin for NormData<'a>

§

impl<'a> UnwindSafe for NormData<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.