[][src]Struct rusb::Device

pub struct Device<T: UsbContext> { /* fields omitted */ }

A reference to a USB device.

Implementations

impl<T: UsbContext> Device<T>[src]

pub fn as_raw(&self) -> *mut libusb_device[src]

Get the raw libusb_device pointer, for advanced use in unsafe code

pub unsafe fn from_libusb(
    context: T,
    device: NonNull<libusb_device>
) -> Device<T>
[src]

Safety

Converts an existing libusb_device pointer into a Device<T>. device must be a pointer to a valid libusb_device. Rusb increments refcount.

pub fn device_descriptor(&self) -> Result<DeviceDescriptor>[src]

Reads the device descriptor.

pub fn config_descriptor(&self, config_index: u8) -> Result<ConfigDescriptor>[src]

Reads a configuration descriptor.

pub fn active_config_descriptor(&self) -> Result<ConfigDescriptor>[src]

Reads the configuration descriptor for the current configuration.

pub fn bus_number(&self) -> u8[src]

Returns the number of the bus that the device is connected to.

pub fn address(&self) -> u8[src]

Returns the device's address on the bus that it's connected to.

pub fn speed(&self) -> Speed[src]

Returns the device's connection speed.

pub fn open(&self) -> Result<DeviceHandle<T>>[src]

Opens the device.

pub fn port_number(&self) -> u8[src]

Returns the device's port number

Trait Implementations

impl<T: UsbContext> Debug for Device<T>[src]

impl<T: UsbContext> Drop for Device<T>[src]

fn drop(&mut self)[src]

Releases the device reference.

impl<T: Eq + UsbContext> Eq for Device<T>[src]

impl<T: PartialEq + UsbContext> PartialEq<Device<T>> for Device<T>[src]

impl<T: UsbContext> Send for Device<T>[src]

impl<T: UsbContext> StructuralEq for Device<T>[src]

impl<T: UsbContext> StructuralPartialEq for Device<T>[src]

impl<T: UsbContext> Sync for Device<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Device<T> where
    T: RefUnwindSafe

impl<T> Unpin for Device<T> where
    T: Unpin

impl<T> UnwindSafe for Device<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.