pub struct DeviceCounters<C = Counter>where
C: CounterRepr,{Show 14 fields
pub send_total_frames: C,
pub send_frame: C,
pub send_bytes: C,
pub send_queue_full: C,
pub send_serialize_error: C,
pub recv_frame: C,
pub recv_bytes: C,
pub recv_parse_error: C,
pub recv_ipv4_delivered: C,
pub recv_ipv6_delivered: C,
pub send_ipv4_frame: C,
pub send_ipv6_frame: C,
pub send_dropped_no_queue: C,
pub send_dropped_dequeue: C,
}Expand description
Device layer counters.
Fields§
§send_total_frames: CCount of outgoing frames which enter the device layer (but may or may not have been dropped prior to reaching the wire).
send_frame: CCount of frames sent.
send_bytes: CCount of bytes sent.
send_queue_full: CCount of frames that failed to send because of a full Tx queue.
send_serialize_error: CCount of frames that failed to send because of a serialization error.
recv_frame: CCount of frames received.
recv_bytes: CCount of bytes received.
recv_parse_error: CCount of incoming frames dropped due to a parsing error.
recv_ipv4_delivered: CCount of incoming frames containing an IPv4 packet delivered.
recv_ipv6_delivered: CCount of incoming frames containing an IPv6 packet delivered.
send_ipv4_frame: CCount of sent frames containing an IPv4 packet.
send_ipv6_frame: CCount of sent frames containing an IPv6 packet.
send_dropped_no_queue: CCount of frames that failed to send because there was no Tx queue.
send_dropped_dequeue: CCount of frames that were dropped during Tx queue dequeuing.
Implementations§
Source§impl DeviceCounters
impl DeviceCounters
Sourcepub fn send_frame<I>(&self) -> &Counterwhere
I: Ip,
pub fn send_frame<I>(&self) -> &Counterwhere
I: Ip,
Either send_ipv4_frame or send_ipv6_frame depending on I.
Source§impl DeviceCounters<u64>
impl DeviceCounters<u64>
Sourcepub fn assert_counters<D, CC>(&self, core_ctx: &CC, device: &D)where
CC: ResourceCounterContext<D, DeviceCounters>,
pub fn assert_counters<D, CC>(&self, core_ctx: &CC, device: &D)where
CC: ResourceCounterContext<D, DeviceCounters>,
Assert that the counters tracked by core_ctx match expectations.
Trait Implementations§
Source§impl<C> CounterCollection for DeviceCounters<C>where
C: CounterRepr,
impl<C> CounterCollection for DeviceCounters<C>where
C: CounterRepr,
Source§type Spec = DeviceCounters
type Spec = DeviceCounters
CounterCollectionSpec associated with this collection.Source§fn cast<C>(&self) -> <Self::Spec as CounterCollectionSpec>::CounterCollection<C>where
C: CounterRepr,
fn cast<C>(&self) -> <Self::Spec as CounterCollectionSpec>::CounterCollection<C>where
C: CounterRepr,
Source§impl CounterCollectionSpec for DeviceCounters
impl CounterCollectionSpec for DeviceCounters
Source§type CounterCollection<C: CounterRepr> = DeviceCounters<C>
type CounterCollection<C: CounterRepr> = DeviceCounters<C>
CounterCollection for this specification.Source§fn transform<C1, C2>(counters: &DeviceCounters<C1>) -> DeviceCounters<C2>where
C1: CounterRepr,
C2: CounterRepr,
fn transform<C1, C2>(counters: &DeviceCounters<C1>) -> DeviceCounters<C2>where
C1: CounterRepr,
C2: CounterRepr,
Self::CounterCollection.Source§impl<BT: BindingsTypes, L> CounterContext<DeviceCounters> for CoreCtx<'_, BT, L>
impl<BT: BindingsTypes, L> CounterContext<DeviceCounters> for CoreCtx<'_, BT, L>
Source§fn counters(&self) -> &DeviceCounters
fn counters(&self) -> &DeviceCounters
Source§impl<C> Debug for DeviceCounters<C>where
C: Debug + CounterRepr,
impl<C> Debug for DeviceCounters<C>where
C: Debug + CounterRepr,
Source§impl<C> Default for DeviceCounters<C>where
C: Default + CounterRepr,
impl<C> Default for DeviceCounters<C>where
C: Default + CounterRepr,
Source§fn default() -> DeviceCounters<C>
fn default() -> DeviceCounters<C>
Source§impl Inspectable for DeviceCounters
impl Inspectable for DeviceCounters
Source§impl<C> PartialEq for DeviceCounters<C>where
C: PartialEq + CounterRepr,
impl<C> PartialEq for DeviceCounters<C>where
C: PartialEq + CounterRepr,
Source§impl<'a, BC: BindingsContext, D: DeviceStateSpec, L> ResourceCounterContext<BaseDeviceId<D, BC>, DeviceCounters> for CoreCtx<'a, BC, L>
impl<'a, BC: BindingsContext, D: DeviceStateSpec, L> ResourceCounterContext<BaseDeviceId<D, BC>, DeviceCounters> for CoreCtx<'a, BC, L>
Source§fn per_resource_counters<'b>(
&'b self,
device_id: &'b BaseDeviceId<D, BC>,
) -> &'b DeviceCounters
fn per_resource_counters<'b>( &'b self, device_id: &'b BaseDeviceId<D, BC>, ) -> &'b DeviceCounters
resource.Source§fn increment_both<F>(&self, resource: &R, cb: F)
fn increment_both<F>(&self, resource: &R, cb: F)
Source§impl<'a, BC: BindingsContext, L> ResourceCounterContext<DeviceId<BC>, DeviceCounters> for CoreCtx<'a, BC, L>
impl<'a, BC: BindingsContext, L> ResourceCounterContext<DeviceId<BC>, DeviceCounters> for CoreCtx<'a, BC, L>
Source§fn per_resource_counters<'b>(
&'b self,
device_id: &'b DeviceId<BC>,
) -> &'b DeviceCounters
fn per_resource_counters<'b>( &'b self, device_id: &'b DeviceId<BC>, ) -> &'b DeviceCounters
resource.Source§fn increment_both<F>(&self, resource: &R, cb: F)
fn increment_both<F>(&self, resource: &R, cb: F)
impl<C> StructuralPartialEq for DeviceCounters<C>where
C: CounterRepr,
Auto Trait Implementations§
impl<C> Freeze for DeviceCounters<C>where
C: Freeze,
impl<C> RefUnwindSafe for DeviceCounters<C>where
C: RefUnwindSafe,
impl<C> Send for DeviceCounters<C>where
C: Send,
impl<C> Sync for DeviceCounters<C>where
C: Sync,
impl<C> Unpin for DeviceCounters<C>where
C: Unpin,
impl<C> UnwindSafe for DeviceCounters<C>where
C: 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
Source§impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more