pub struct RusbDevice { /* private fields */ }Expand description
Represents a device provided by the rusb crate.
Implementations§
Trait Implementations§
Source§impl UsbDevice for RusbDevice
impl UsbDevice for RusbDevice
Source§fn get_serial_number(&self) -> Option<&str>
fn get_serial_number(&self) -> Option<&str>
Gets the usb serial number of the device.
Source§fn get_timeout(&self) -> Duration
fn get_timeout(&self) -> Duration
Get the default timeout for operations.
Source§fn get_parent(&self) -> Result<Box<dyn UsbDevice>>
fn get_parent(&self) -> Result<Box<dyn UsbDevice>>
Try to get the parent of this device (or None if root).
Source§fn get_vendor_id(&self) -> u16
fn get_vendor_id(&self) -> u16
Return the VID of the device.
Source§fn get_product_id(&self) -> u16
fn get_product_id(&self) -> u16
Return the PID of the device.
Source§fn claim_interface(&self, iface: u8) -> Result<()>
fn claim_interface(&self, iface: u8) -> Result<()>
Claim an interface for use with the kernel.
Source§fn release_interface(&self, iface: u8) -> Result<()>
fn release_interface(&self, iface: u8) -> Result<()>
Release a previously claimed interface to the kernel.
Source§fn set_alternate_setting(&self, iface: u8, setting: u8) -> Result<()>
fn set_alternate_setting(&self, iface: u8, setting: u8) -> Result<()>
Set an interface alternate setting.
Source§fn kernel_driver_active(&self, iface: u8) -> Result<bool>
fn kernel_driver_active(&self, iface: u8) -> Result<bool>
Check whether a kernel driver currentl controls the device.
Source§fn detach_kernel_driver(&self, iface: u8) -> Result<()>
fn detach_kernel_driver(&self, iface: u8) -> Result<()>
Detach the kernel driver from the device.
Source§fn attach_kernel_driver(&self, iface: u8) -> Result<()>
fn attach_kernel_driver(&self, iface: u8) -> Result<()>
Attach the kernel driver to the device.
Source§fn device_descriptor(&self) -> Device<'_>
fn device_descriptor(&self) -> Device<'_>
Return the device’s descriptor.
Source§fn active_configuration(&self) -> Result<Configuration<'_>>
fn active_configuration(&self) -> Result<Configuration<'_>>
Return the currently active configuration’s descriptor.
Source§fn bus_number(&self) -> u8
fn bus_number(&self) -> u8
Return the device’s bus number.
Source§fn port_numbers(&self) -> Result<Vec<u8>>
fn port_numbers(&self) -> Result<Vec<u8>>
Return the sequence of port numbers from the root down to the device.
Source§fn read_string_descriptor_ascii(&self, idx: u8) -> Result<String>
fn read_string_descriptor_ascii(&self, idx: u8) -> Result<String>
Return a string descriptor in ASCII.
Source§fn write_control_timeout(
&self,
request_type: u8,
request: u8,
value: u16,
index: u16,
buf: &[u8],
timeout: Duration,
) -> Result<usize>
fn write_control_timeout( &self, request_type: u8, request: u8, value: u16, index: u16, buf: &[u8], timeout: Duration, ) -> Result<usize>
Issue a USB control request with optional host-to-device data.
Source§fn read_control_timeout(
&self,
request_type: u8,
request: u8,
value: u16,
index: u16,
buf: &mut [u8],
timeout: Duration,
) -> Result<usize>
fn read_control_timeout( &self, request_type: u8, request: u8, value: u16, index: u16, buf: &mut [u8], timeout: Duration, ) -> Result<usize>
Issue a USB control request with optional device-to-host data.
Source§fn read_bulk_timeout(
&self,
endpoint: u8,
data: &mut [u8],
timeout: Duration,
) -> Result<usize>
fn read_bulk_timeout( &self, endpoint: u8, data: &mut [u8], timeout: Duration, ) -> Result<usize>
Read bulk data bytes to given USB endpoint.
Source§fn write_bulk_timeout(
&self,
endpoint: u8,
data: &[u8],
timeout: Duration,
) -> Result<usize>
fn write_bulk_timeout( &self, endpoint: u8, data: &[u8], timeout: Duration, ) -> Result<usize>
Write bulk data bytes to given USB endpoint.
Source§fn write_control(
&self,
request_type: u8,
request: u8,
value: u16,
index: u16,
buf: &[u8],
) -> Result<usize>
fn write_control( &self, request_type: u8, request: u8, value: u16, index: u16, buf: &[u8], ) -> Result<usize>
Issue a USB control request with optional host-to-device data. Read more
Source§fn read_control(
&self,
request_type: u8,
request: u8,
value: u16,
index: u16,
buf: &mut [u8],
) -> Result<usize>
fn read_control( &self, request_type: u8, request: u8, value: u16, index: u16, buf: &mut [u8], ) -> Result<usize>
Issue a USB control request with optional device-to-host data. Read more
Auto Trait Implementations§
impl !Freeze for RusbDevice
impl RefUnwindSafe for RusbDevice
impl Send for RusbDevice
impl Sync for RusbDevice
impl Unpin for RusbDevice
impl UnwindSafe for RusbDevice
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