xarxa-driver

Crates

git

Versions

default

Flavors

Skip to main content

PacketMeta

Struct PacketMeta 

Source
#[non_exhaustive]
pub struct PacketMeta { pub id: u32, pub timestamp: Option<Timestamp>, pub request_timestamp: bool, }
Expand description

Metadata associated with a packet.

This struct is #[non_exhaustive]. Start from Default and set what you care about:

let mut meta = xarxa_driver::PacketMeta::default();
meta.id = 15;

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§id: u32

An opaque identifier for this packet.

On received packets it is set by the driver. On packets to transmit it is set by the application and handed to the driver untouched. It is also used to correlates a transmit timestamp back to the packet that produced it, see Driver::poll_tx_timestamp.

Defaults to 0.

§timestamp: Option<Timestamp>

The time at which this packet was received, as measured by the device.

None if the device did not timestamp this packet. Devices commonly timestamp only a subset of received packets, e.g. only PTP event messages.

Meaningful on received packets only. It is ignored on packets to transmit.

§request_timestamp: bool

Request that the device timestamp this packet as it is transmitted.

The timestamp is reported back later, out of band, by Driver::poll_tx_timestamp, tagged with this packet’s id.

Meaningful on packets to transmit only, ignored on received packets.

Timestamping is opt-in per packet because hardware typically has only a handful of transmit timestamp slots: requesting one for every packet will cause most of them to be dropped.

Trait Implementations§

Source§

impl Clone for PacketMeta

Source§

fn clone(&self) -> PacketMeta

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 Copy for PacketMeta

Source§

impl Debug for PacketMeta

Source§

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

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

impl Default for PacketMeta

Source§

fn default() -> PacketMeta

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

impl Eq for PacketMeta

Source§

impl Hash for PacketMeta

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 PartialEq for PacketMeta

Source§

fn eq(&self, other: &PacketMeta) -> bool

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PacketMeta

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.