Struct xsk_rs::config::UmemConfigBuilder
source · [−]pub struct UmemConfigBuilder { /* private fields */ }
Expand description
Builder for a UmemConfig
.
Implementations
sourceimpl ConfigBuilder
impl ConfigBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new UmemConfigBuilder
instance.
sourcepub fn frame_size(&mut self, size: FrameSize) -> &mut Self
pub fn frame_size(&mut self, size: FrameSize) -> &mut Self
Set the frame size. Default is
XSK_UMEM__DEFAULT_FRAME_SIZE
.
sourcepub fn fill_queue_size(&mut self, size: QueueSize) -> &mut Self
pub fn fill_queue_size(&mut self, size: QueueSize) -> &mut Self
Set the FillQueue
size. Default is
XSK_RING_PROD__DEFAULT_NUM_DESCS
.
sourcepub fn comp_queue_size(&mut self, size: QueueSize) -> &mut Self
pub fn comp_queue_size(&mut self, size: QueueSize) -> &mut Self
Set the CompQueue
size. Default is
XSK_RING_CONS__DEFAULT_NUM_DESCS
.
sourcepub fn frame_headroom(&mut self, headroom: u32) -> &mut Self
pub fn frame_headroom(&mut self, headroom: u32) -> &mut Self
Set the frame headroom available to the user. Default size is
XSK_UMEM__DEFAULT_FRAME_HEADROOM
.
Not to be confused with XDP_PACKET_HEADROOM
which is the
amount of headroom reserved by XDP.
sourcepub fn build(&self) -> Result<Config, ConfigBuildError>
pub fn build(&self) -> Result<Config, ConfigBuildError>
Build a UmemConfig
instance using the values set
in this builder.
May fail if some of the values are incompatible. For example, if the requested frame headroom exceeds the frame size.
Trait Implementations
sourceimpl Clone for ConfigBuilder
impl Clone for ConfigBuilder
sourcefn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConfigBuilder
impl Debug for ConfigBuilder
sourceimpl Default for ConfigBuilder
impl Default for ConfigBuilder
sourcefn default() -> ConfigBuilder
fn default() -> ConfigBuilder
Returns the “default value” for a type. Read more
impl Copy for ConfigBuilder
Auto Trait Implementations
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more