#[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
Device
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.
Currently only UDP sockets allow setting/retrieving packet metadata. The metadata for packets emitted with other sockets will be all default values.
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 = smoltcp::phy::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
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for PacketMeta
impl Debug for PacketMeta
Source§impl Default for PacketMeta
impl Default for PacketMeta
Source§fn default() -> PacketMeta
fn default() -> PacketMeta
Source§impl Hash for PacketMeta
impl Hash for PacketMeta
Source§impl PartialEq for PacketMeta
impl PartialEq for PacketMeta
impl Copy for PacketMeta
impl Eq 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 UnwindSafe for PacketMeta
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)