netstack3_device

Trait DeviceCollectionContext

Source
pub trait DeviceCollectionContext<D: Device + DeviceStateSpec, BT: DeviceLayerTypes>: DeviceIdContext<D> {
    // Required methods
    fn insert(&mut self, device: BasePrimaryDeviceId<D, BT>);
    fn remove(
        &mut self,
        device: &BaseDeviceId<D, BT>,
    ) -> Option<BasePrimaryDeviceId<D, BT>>;
}
Expand description

A context providing facilities to store and remove primary device IDs.

This allows the device layer APIs to be written generically on D.

Required Methods§

Source

fn insert(&mut self, device: BasePrimaryDeviceId<D, BT>)

Adds device to the device collection.

Source

fn remove( &mut self, device: &BaseDeviceId<D, BT>, ) -> Option<BasePrimaryDeviceId<D, BT>>

Removes device from the collection, if it exists.

Implementors§