Struct netstack3_device::queue::TransmitQueueApi
source · pub struct TransmitQueueApi<D, C>(/* private fields */);
Expand description
An API to interact with device D
transmit queues.
Implementations§
source§impl<D, C> TransmitQueueApi<D, C>
impl<D, C> TransmitQueueApi<D, C>
sourcepub fn new(ctx: C) -> Self
pub fn new(ctx: C) -> Self
Creates a new TransmitQueueApi
from ctx
.
source§impl<D, C> TransmitQueueApi<D, C>where
D: Device,
C: ContextPair,
C::CoreContext: TransmitDequeueContext<D, C::BindingsContext> + DeviceSocketHandler<D, C::BindingsContext>,
for<'a> <C::CoreContext as TransmitDequeueContext<D, C::BindingsContext>>::TransmitQueueCtx<'a>: ResourceCounterContext<<C::CoreContext as DeviceIdContext<D>>::DeviceId, DeviceCounters>,
C::BindingsContext: TransmitQueueBindingsContext<<C::CoreContext as DeviceIdContext<D>>::DeviceId>,
impl<D, C> TransmitQueueApi<D, C>where
D: Device,
C: ContextPair,
C::CoreContext: TransmitDequeueContext<D, C::BindingsContext> + DeviceSocketHandler<D, C::BindingsContext>,
for<'a> <C::CoreContext as TransmitDequeueContext<D, C::BindingsContext>>::TransmitQueueCtx<'a>: ResourceCounterContext<<C::CoreContext as DeviceIdContext<D>>::DeviceId, DeviceCounters>,
C::BindingsContext: TransmitQueueBindingsContext<<C::CoreContext as DeviceIdContext<D>>::DeviceId>,
sourcepub fn transmit_queued_frames(
&mut self,
device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
batch_size: BatchSize,
dequeue_context: &mut <C::CoreContext as TransmitQueueCommon<D, C::BindingsContext>>::DequeueContext,
) -> Result<WorkQueueReport, DeviceSendFrameError>
pub fn transmit_queued_frames( &mut self, device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, batch_size: BatchSize, dequeue_context: &mut <C::CoreContext as TransmitQueueCommon<D, C::BindingsContext>>::DequeueContext, ) -> Result<WorkQueueReport, DeviceSendFrameError>
Transmits any queued frames.
Up to batch_size
frames will attempt to be dequeued and sent in this
call.
dequeue_context
is directly given to the context to operate on each
individual frame.
sourcepub fn count(
&mut self,
device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
) -> Option<usize>
pub fn count( &mut self, device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, ) -> Option<usize>
Returns the number of frames in device_id
’s TX queue.
Returns None
if the device doesn’t have a queue configured.
sourcepub fn set_configuration(
&mut self,
device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId,
config: TransmitQueueConfiguration,
)
pub fn set_configuration( &mut self, device_id: &<C::CoreContext as DeviceIdContext<D>>::DeviceId, config: TransmitQueueConfiguration, )
Sets the queue configuration for the device.
Auto Trait Implementations§
impl<D, C> Freeze for TransmitQueueApi<D, C>where
C: Freeze,
impl<D, C> RefUnwindSafe for TransmitQueueApi<D, C>where
C: RefUnwindSafe,
D: RefUnwindSafe,
impl<D, C> Send for TransmitQueueApi<D, C>
impl<D, C> Sync for TransmitQueueApi<D, C>
impl<D, C> Unpin for TransmitQueueApi<D, C>
impl<D, C> UnwindSafe for TransmitQueueApi<D, C>where
C: UnwindSafe,
D: UnwindSafe,
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<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