#[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
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.id: u32An 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: boolRequest 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
impl Clone for PacketMeta
Source§fn clone(&self) -> PacketMeta
fn clone(&self) -> PacketMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more