pub enum DataPayload<T, F> {
    Encrypted(EncryptedDataPayload<T, F>),
    Decrypted(DecryptedDataPayload<T>),
}
Expand description

DataPayload is a type that represents a ConfirmedDataUp, ConfirmedDataDown, UnconfirmedDataUp or UnconfirmedDataDown.

It can either be encrypted for example as a result from the parse function or not.

Variants§

§

Encrypted(EncryptedDataPayload<T, F>)

§

Decrypted(DecryptedDataPayload<T>)

Trait Implementations§

source§

impl<T: AsRef<[u8]>, F> DataHeader for DataPayload<T, F>

source§

fn as_data_bytes(&self) -> &[u8]

Equivalent to AsRef<u8>.
source§

fn fhdr(&self) -> FHDR<'_>

Gives the FHDR of the DataPayload.
source§

fn is_confirmed(&self) -> bool

Gives whether the frame is confirmed
Gives whether the payload is uplink or not.
source§

fn f_port(&self) -> Option<u8>

Gives the FPort of the DataPayload if there is one.
source§

fn fhdr_length(&self) -> usize

Gives the length of the FHDR field.
source§

impl<T: Debug, F: Debug> Debug for DataPayload<T, F>

source§

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

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

impl<T: PartialEq, F: PartialEq> PartialEq for DataPayload<T, F>

source§

fn eq(&self, other: &DataPayload<T, F>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: Eq, F: Eq> Eq for DataPayload<T, F>

source§

impl<T, F> StructuralEq for DataPayload<T, F>

source§

impl<T, F> StructuralPartialEq for DataPayload<T, F>

Auto Trait Implementations§

§

impl<T, F> RefUnwindSafe for DataPayload<T, F>

§

impl<T, F> Send for DataPayload<T, F>
where F: Send, T: Send,

§

impl<T, F> Sync for DataPayload<T, F>
where F: Sync, T: Sync,

§

impl<T, F> Unpin for DataPayload<T, F>
where F: Unpin, T: Unpin,

§

impl<T, F> UnwindSafe for DataPayload<T, F>
where F: UnwindSafe, T: 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> AsPhyPayloadBytes for T
where T: DataHeader,

source§

fn as_bytes(&self) -> &[u8]

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

source§

fn mhdr(&self) -> MHDR

Gives the MIC of the PhyPayload.
source§

impl<T> MICAble for T

source§

fn mic(&self) -> MIC

Gives the MIC of the PhyPayload.
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

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

§

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>,

§

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.