Struct netstack3_device::queue::BatchSize
source · pub struct BatchSize(/* private fields */);
Expand description
A type representing an operation count in a queue (e.g. the number of packets allowed to be dequeued in a single operation).
BatchSize
is always capped at the maximum supported batch size for the
queue and defaults to that value.
Implementations§
source§impl BatchSize
impl BatchSize
sourcepub const MAX: usize = 100usize
pub const MAX: usize = 100usize
The maximum usize value that BatchSize
can assume.
Restricting the amount of work that can be done at once in a queue serves two purposes:
- It sets an upper bound on the amount of work that can be done before yielding the thread to other work.
- It sets an upper bound of memory consumption set aside for dequeueing, because dequeueing takes frames from the queue and “stages” them in a separate context.
sourcepub fn new_saturating(v: usize) -> Self
pub fn new_saturating(v: usize) -> Self
Creates a new BatchSize
with a value of v
saturating to
BatchSize::MAX
.
Trait Implementations§
source§impl PartialEq for BatchSize
impl PartialEq for BatchSize
impl Copy for BatchSize
impl Eq for BatchSize
impl StructuralPartialEq for BatchSize
Auto Trait Implementations§
impl Freeze for BatchSize
impl RefUnwindSafe for BatchSize
impl Send for BatchSize
impl Sync for BatchSize
impl Unpin for BatchSize
impl UnwindSafe for BatchSize
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
source§impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more