#[non_exhaustive]pub struct PacketMeta {}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;
}Trait Implementations§
Source§impl Clone for PacketMeta
impl Clone for PacketMeta
Source§fn clone(&self) -> PacketMeta
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for PacketMeta
Source§impl Debug for PacketMeta
impl Debug for PacketMeta
Source§impl Default for PacketMeta
impl Default for PacketMeta
Source§fn default() -> PacketMeta
fn default() -> PacketMeta
Returns the “default value” for a type. Read more
impl Eq for PacketMeta
Source§impl Format for PacketMeta
impl Format for PacketMeta
Source§impl Hash for PacketMeta
impl Hash for PacketMeta
Source§impl PartialEq for PacketMeta
impl PartialEq for PacketMeta
impl StructuralPartialEq for PacketMeta
Auto Trait Implementations§
impl Freeze for PacketMeta
impl RefUnwindSafe for PacketMeta
impl Send for PacketMeta
impl Sync for PacketMeta
impl Unpin for PacketMeta
impl UnsafeUnpin for PacketMeta
impl UnwindSafe for PacketMeta
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more