Trait IdTable

Source
pub trait IdTable<T: RawDeviceId, U> {
    // Required methods
    fn as_ptr(&self) -> *const T::RawType;
    fn id(&self, index: usize) -> &T::RawType;
    fn info(&self, index: usize) -> &U;
}
Expand description

A device id table.

This trait is only implemented by IdArray.

The purpose of this trait is to allow &'static dyn IdArray<T, U> to be in context when N in IdArray doesn’t matter.

Required Methods§

Source

fn as_ptr(&self) -> *const T::RawType

Obtain the pointer to the ID table.

Source

fn id(&self, index: usize) -> &T::RawType

Obtain the pointer to the bus specific device ID from an index.

Source

fn info(&self, index: usize) -> &U

Obtain the pointer to the driver-specific information from an index.

Implementors§

Source§

impl<T: RawDeviceId, U, const N: usize> IdTable<T, U> for IdArray<T, U, N>