Struct DataFrame

Source
pub struct DataFrame<'a, DataFramePayload = &'a [u8]> {
    pub header: DataFrameHeader,
    pub payload: Option<DataFramePayload>,
    pub _phantom: PhantomData<&'a ()>,
}
Expand description

This is a data frame.

The individual subtypes don’t have there own seperate structs, since the only difference is the header.

Fields§

§header: DataFrameHeader

This is the header of the data frame.

§payload: Option<DataFramePayload>

This is the payload of the data frame. It will be set to None for all null function frames. NOTE: This may be crypto wrapped, so using DataFrame::potentially_wrapped_payload is recommended.

§_phantom: PhantomData<&'a ()>

Implementations§

Source§

impl DataFrame<'_>

Source

pub const fn length_in_bytes(&self) -> usize

The total length in bytes.

Source

pub fn potentially_wrapped_payload( &self, mic_state: Option<MicState>, ) -> Option<PotentiallyWrappedPayload<DataFrameReadPayload<'_>>>

Get the potentially wrapped inner payload.

If the payload is protected, but mic_state is None, None will be returned.

Source§

impl<'a, P> DataFrame<'a, P>

Source

pub fn crypto_wrap( self, crypto_header: CryptoHeader, mic_state: MicState, ) -> DataFrame<'a, CryptoWrapper<P>>

Wrap the payload in a CryptoWrapper.

Source§

impl<'a, KeyMic: AsRef<[u8]>, ElementContainer> DataFrame<'a, SnapLlcFrame<'a, EapolKeyFrame<'a, KeyMic, ElementContainer>>>

Source

pub fn eapol_mic_range(&self) -> Option<Range<usize>>

Get the range in which the EAPOL MIC field is in the serialized data frame.

Source

pub fn eapol_key_data_length_range(&self) -> Option<Range<usize>>

Get the range in which the EAPOL Key Data Length field is in the serialized data frame.

Source

pub fn eapol_key_data_range(&self) -> Option<RangeFrom<usize>>

Get the range in which the EAPOL Key Data field is in the serialized data frame.

Trait Implementations§

Source§

impl<'a, DataFramePayload: Clone> Clone for DataFrame<'a, DataFramePayload>

Source§

fn clone(&self) -> DataFrame<'a, DataFramePayload>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a, DataFramePayload: Debug> Debug for DataFrame<'a, DataFramePayload>

Source§

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

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

impl<'a, DataFramePayload: Default> Default for DataFrame<'a, DataFramePayload>

Source§

fn default() -> DataFrame<'a, DataFramePayload>

Returns the “default value” for a type. Read more
Source§

impl<'a, DataFramePayload> Format for DataFrame<'a, DataFramePayload>
where DataFrameHeader: Format, Option<DataFramePayload>: Format, PhantomData<&'a ()>: Format,

Source§

fn format(&self, f: Formatter<'_>)

Writes the defmt representation of self to fmt.
Source§

impl<'a, DataFramePayload: Hash> Hash for DataFrame<'a, DataFramePayload>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Payload> IEEE80211Frame for DataFrame<'_, Payload>

Source§

impl<DataFramePayload: MeasureWith<()>> MeasureWith<bool> for DataFrame<'_, DataFramePayload>

Source§

fn measure_with(&self, with_fcs: &bool) -> usize

How large is Self, given the ctx?
Source§

impl<'a, DataFramePayload: PartialEq> PartialEq for DataFrame<'a, DataFramePayload>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> TryFromCtx<'a, bool> for DataFrame<'a>

Source§

type Error = Error

Source§

fn try_from_ctx( from: &'a [u8], with_fcs: bool, ) -> Result<(Self, usize), Self::Error>

Source§

impl<Payload: TryIntoCtx<Error = Error>> TryIntoCtx<bool> for DataFrame<'_, Payload>

Source§

type Error = Error

Source§

fn try_into_ctx( self, buf: &mut [u8], with_fcs: bool, ) -> Result<usize, Self::Error>

Source§

impl<'a, DataFramePayload: Copy> Copy for DataFrame<'a, DataFramePayload>

Source§

impl<'a, DataFramePayload: Eq> Eq for DataFrame<'a, DataFramePayload>

Source§

impl<'a, DataFramePayload> StructuralPartialEq for DataFrame<'a, DataFramePayload>

Auto Trait Implementations§

§

impl<'a, DataFramePayload> Freeze for DataFrame<'a, DataFramePayload>
where DataFramePayload: Freeze,

§

impl<'a, DataFramePayload> RefUnwindSafe for DataFrame<'a, DataFramePayload>
where DataFramePayload: RefUnwindSafe,

§

impl<'a, DataFramePayload> Send for DataFrame<'a, DataFramePayload>
where DataFramePayload: Send,

§

impl<'a, DataFramePayload> Sync for DataFrame<'a, DataFramePayload>
where DataFramePayload: Sync,

§

impl<'a, DataFramePayload> Unpin for DataFrame<'a, DataFramePayload>
where DataFramePayload: Unpin,

§

impl<'a, DataFramePayload> UnwindSafe for DataFrame<'a, DataFramePayload>
where DataFramePayload: UnwindSafe,

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> Same for T

Source§

type Output = T

Should always be Self
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.