pub struct RusbContext {}Expand description
Represents a backend using the rusb crate.
Implementations§
Source§impl RusbContext
impl RusbContext
Trait Implementations§
Source§impl Default for RusbContext
impl Default for RusbContext
Source§fn default() -> RusbContext
fn default() -> RusbContext
Returns the “default value” for a type. Read more
Source§impl UsbContext for RusbContext
impl UsbContext for RusbContext
Source§fn scan(
&self,
usb_vid: Option<u16>,
usb_pid: Option<u16>,
usb_protocol: Option<(u8, u8, u8)>,
usb_serial: Option<&str>,
) -> Result<Vec<Box<dyn UsbDevice>>>
fn scan( &self, usb_vid: Option<u16>, usb_pid: Option<u16>, usb_protocol: Option<(u8, u8, u8)>, usb_serial: Option<&str>, ) -> Result<Vec<Box<dyn UsbDevice>>>
Scan the USB bus for devices matching VID/PID, and optionally also matching a serial
number. This method always returns immediately with the list of currently plugged
devices matching the requested criteria.
Source§fn device_by_id(
&self,
usb_vid: u16,
usb_pid: u16,
usb_serial: Option<&str>,
) -> Result<Box<dyn UsbDevice>>
fn device_by_id( &self, usb_vid: u16, usb_pid: u16, usb_serial: Option<&str>, ) -> Result<Box<dyn UsbDevice>>
Find a device by VID:PID, and optionally disambiguate by serial number. Read more
Source§fn device_by_id_with_timeout(
&self,
usb_vid: u16,
usb_pid: u16,
usb_serial: Option<&str>,
timeout: Duration,
) -> Result<Box<dyn UsbDevice>>
fn device_by_id_with_timeout( &self, usb_vid: u16, usb_pid: u16, usb_serial: Option<&str>, timeout: Duration, ) -> Result<Box<dyn UsbDevice>>
Find a device by VID:PID, and optionally disambiguate by serial number. Read more
Auto Trait Implementations§
impl Freeze for RusbContext
impl RefUnwindSafe for RusbContext
impl Send for RusbContext
impl Sync for RusbContext
impl Unpin for RusbContext
impl UnwindSafe for RusbContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more