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§

impl<'a, BT, L> DeviceCollectionContext<BlackholeDevice, BT> for CoreCtx<'a, BT, L>
where BT: BindingsTypes, L: LockBefore<DeviceLayerState>,

impl<'a, BT, L> DeviceCollectionContext<EthernetLinkDevice, BT> for CoreCtx<'a, BT, L>
where BT: BindingsTypes, L: LockBefore<DeviceLayerState>,

impl<'a, BT, L> DeviceCollectionContext<LoopbackDevice, BT> for CoreCtx<'a, BT, L>
where BT: BindingsTypes, L: LockBefore<DeviceLayerState>,

impl<'a, BT, L> DeviceCollectionContext<PureIpDevice, BT> for CoreCtx<'a, BT, L>
where BT: BindingsTypes, L: LockBefore<DeviceLayerState>,