pub trait DeviceStateSpec:
Device
+ Sized
+ Send
+ Sync
+ 'static {
type State<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_device_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::State<BC>;
}
Expand description
Provides the specifications for device state held by [BaseDeviceId
] in
[BaseDeviceState
].
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 Associated Types§
Sourcetype State<BT: DeviceLayerTypes>: Send + Sync
type State<BT: DeviceLayerTypes>: Send + Sync
The device 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 Methods§
Sourcefn new_device_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::State<BC>
fn new_device_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::State<BC>
Creates a new device state from the given properties.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.