netstack3_device

Trait 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 Constants§

Source

const IS_LOOPBACK: bool

Marker for loopback devices.

Source

const DEBUG_TYPE: &'static str

Marker used to print debug information for device identifiers.

Required Associated Types§

The link state.

Source

type External<BT: DeviceLayerTypes>: Send + Sync

The external (bindings) state.

Source

type CreationProperties: Debug

Properties given to device creation.

Source

type Counters: Inspectable

Device-specific counters.

Source

type TimerId<D: WeakDeviceIdentifier>

The timer identifier required by this device state.

Required Methods§

Creates a new link 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.

Implementors§