pub struct MmapArea<'a, T: Default + Copy> { /* private fields */ }Expand description
A mapped memory area used to move packets between the kernel and userspace. One or more Umem instances can share a Mmaparea.
Implementations§
Source§impl<'a, T: Default + Copy> MmapArea<'a, T>
impl<'a, T: Default + Copy> MmapArea<'a, T>
Sourcepub fn new(
buf_num: usize,
buf_len: usize,
options: MmapAreaOptions,
) -> Result<(Arc<MmapArea<'a, T>>, Vec<BufMmap<'a, T>>), MmapError>
pub fn new( buf_num: usize, buf_len: usize, options: MmapAreaOptions, ) -> Result<(Arc<MmapArea<'a, T>>, Vec<BufMmap<'a, T>>), MmapError>
Allocate a new memory mapped area based on the size and number of buffers
§Arguments
- buf_num: The number of buffers to allocate in the memory mapped area
- buf_len: The length of each buffer
- options: Configuration options
Sourcepub fn get_buf_num(&self) -> usize
pub fn get_buf_num(&self) -> usize
Get the number of buffers in the memory mapped area.
Trait Implementations§
impl<'a, T: Default + Copy> Send for MmapArea<'a, T>
impl<'a, T: Default + Copy> Sync for MmapArea<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for MmapArea<'a, T>
impl<'a, T> RefUnwindSafe for MmapArea<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Unpin for MmapArea<'a, T>
impl<'a, T> UnsafeUnpin for MmapArea<'a, T>
impl<'a, T> UnwindSafe for MmapArea<'a, T>where
T: RefUnwindSafe,
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