Trait netstack3_device::DeviceStateSpec
source · pub trait DeviceStateSpec: Device + Sized + Send + Sync + 'static {
type Link<BT: DeviceLayerTypes>: Send + Sync;
type External<BT: DeviceLayerTypes>: Send + Sync;
type CreationProperties: Debug;
type Counters: Inspectable;
type TimerId<D: WeakDeviceIdentifier>;
const IS_LOOPBACK: bool;
const DEBUG_TYPE: &'static str;
// Required method
fn new_link_state<CC: CoreTimerContext<Self::TimerId<CC::WeakDeviceId>, BC> + DeviceIdContext<Self>, BC: DeviceLayerTypes + TimerContext>(
bindings_ctx: &mut BC,
self_id: CC::WeakDeviceId,
properties: Self::CreationProperties,
) -> Self::Link<BC>;
}
Expand description
Provides the specifications for device state held by [BaseDeviceId
] in
[BaseDeviceState
].
Required Associated Types§
sourcetype Link<BT: DeviceLayerTypes>: Send + Sync
type Link<BT: DeviceLayerTypes>: Send + Sync
The link state.
sourcetype External<BT: DeviceLayerTypes>: Send + Sync
type External<BT: DeviceLayerTypes>: Send + Sync
The external (bindings) state.
sourcetype CreationProperties: Debug
type CreationProperties: Debug
Properties given to device creation.
sourcetype Counters: Inspectable
type Counters: Inspectable
Device-specific counters.
sourcetype TimerId<D: WeakDeviceIdentifier>
type TimerId<D: WeakDeviceIdentifier>
The timer identifier required by this device state.
Required Associated Constants§
sourceconst IS_LOOPBACK: bool
const IS_LOOPBACK: bool
Marker for loopback devices.
sourceconst DEBUG_TYPE: &'static str
const DEBUG_TYPE: &'static str
Marker used to print debug information for device identifiers.
Required Methods§
sourcefn new_link_state<CC: CoreTimerContext<Self::TimerId<CC::WeakDeviceId>, BC> + DeviceIdContext<Self>, BC: DeviceLayerTypes + TimerContext>(
bindings_ctx: &mut BC,
self_id: CC::WeakDeviceId,
properties: Self::CreationProperties,
) -> Self::Link<BC>
fn new_link_state<CC: CoreTimerContext<Self::TimerId<CC::WeakDeviceId>, BC> + DeviceIdContext<Self>, BC: DeviceLayerTypes + TimerContext>( bindings_ctx: &mut BC, self_id: CC::WeakDeviceId, properties: Self::CreationProperties, ) -> Self::Link<BC>
Creates a new link state from the given properties.
Object Safety§
This trait is not object safe.