Struct driver_net::NetBufPool
source · pub struct NetBufPool { /* private fields */ }
Expand description
A pool of NetBuf
s to speed up buffer allocation.
It divides a large memory into several equal parts for each buffer.
Implementations§
source§impl NetBufPool
impl NetBufPool
sourcepub fn new(capacity: usize, buf_len: usize) -> DevResult<Arc<Self>>
pub fn new(capacity: usize, buf_len: usize) -> DevResult<Arc<Self>>
Creates a new pool with the given capacity
, and all buffer lengths are
set to buf_len
.
sourcepub const fn buffer_len(&self) -> usize
pub const fn buffer_len(&self) -> usize
Returns the length of each buffer.
Auto Trait Implementations§
impl !RefUnwindSafe for NetBufPool
impl Send for NetBufPool
impl Sync for NetBufPool
impl Unpin for NetBufPool
impl UnwindSafe for NetBufPool
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