pub trait Context<'a> {
type Device: Device<'a>;
type DeviceInfo: DeviceInfo;
// Required methods
fn list_devices(&self) -> Result<Vec<Self::DeviceInfo>>;
fn device(
&self,
id: &<Self::DeviceInfo as DeviceInfo>::Id,
) -> Result<Self::Device>;
}Expand description
The entry point for discovering and opening devices.
Required Associated Types§
Sourcetype DeviceInfo: DeviceInfo
type DeviceInfo: DeviceInfo
The device-info type returned by Context::list_devices.
Required Methods§
Sourcefn list_devices(&self) -> Result<Vec<Self::DeviceInfo>>
fn list_devices(&self) -> Result<Vec<Self::DeviceInfo>>
Lists all available devices.
Sourcefn device(
&self,
id: &<Self::DeviceInfo as DeviceInfo>::Id,
) -> Result<Self::Device>
fn device( &self, id: &<Self::DeviceInfo as DeviceInfo>::Id, ) -> Result<Self::Device>
Opens the device with the given ID.