#[non_exhaustive]pub struct PacketMeta {
pub id: u32,
}Expand description
Metadata associated to a packet.
The packet metadata is a set of attributes associated to network packets
as they travel up or down the stack. The metadata is get/set by the
Driver implementations or by the user when sending/receiving packets from a
socket.
Metadata fields are enabled via Cargo features. If no field is enabled, this struct becomes zero-sized, which allows the compiler to optimize it out as if the packet metadata mechanism didn’t exist at all.
This struct is marked as #[non_exhaustive]. This means it is not possible to
create it directly by specifying all fields. You have to instead create it with
default values and then set the fields you want. This makes adding metadata
fields a non-breaking change.
let mut meta = xarxa_driver::PacketMeta::default();
#[cfg(feature = "packetmeta-id")]
{
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, this is set by the [Device]. On packets to transmit,
this is set by the user and passed down to the [Device]; it is also what
correlates a transmit timestamp back to the packet that produced it, see
[Device::poll_tx_timestamp].
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