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: usizeSize of the storage at data, in bytes.
headroom: usizeOffset of the first valid byte within the storage.
len: usizeNumber of valid bytes.
meta: PacketMetaPer-packet metadata. Zero-sized unless a packetmeta-* feature is enabled.
Auto Trait Implementations§
impl !Send for RawPacketBuf
impl !Sync for RawPacketBuf
impl Freeze for RawPacketBuf
impl RefUnwindSafe for RawPacketBuf
impl Unpin for RawPacketBuf
impl UnsafeUnpin for RawPacketBuf
impl UnwindSafe for RawPacketBuf
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