xarxa-driver

Crates

git

Versions

default

Flavors

Skip to main content

RawPacketBuf

Struct RawPacketBuf 

Source
pub struct RawPacketBuf {
    pub free: unsafe fn(NonNull<RawPacketBuf>),
    pub pool: *const (),
    pub data: NonNull<u8>,
    pub capacity: usize,
    pub headroom: usize,
    pub len: usize,
    pub meta: PacketMeta,
}
Expand description

The bookkeeping of one PacketBuf: where its storage is, its headroom and length, its metadata, and how to free it.

Only pool implementations deal with this type. They keep one for each buffer, fill it in, and pass it to PacketBuf::from_raw.

Fields§

§free: unsafe fn(NonNull<RawPacketBuf>)

Called with this RawPacketBuf when the buffer is dropped. It gives the buffer back to its pool.

§pool: *const ()

For the pool’s own use, for example to find itself in free. The buffer never reads it.

§data: NonNull<u8>

Start of the storage.

§capacity: usize

Size of the storage at data, in bytes.

§headroom: usize

Offset of the first valid byte within the storage.

§len: usize

Number of valid bytes.

§meta: PacketMeta

Per-packet metadata. Zero-sized unless a packetmeta-* feature is enabled.

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> 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.