Struct rusb::Device

source · []
pub struct Device<T: UsbContext> { /* private fields */ }
Expand description

A reference to a USB device.

Implementations

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

Get the context associated with this device

Safety

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

Reads the device descriptor.

Reads a configuration descriptor.

Reads the configuration descriptor for the current configuration.

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

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

Returns the device’s connection speed.

Opens the device.

Returns the device’s port number

Returns the device’s parent

Get the list of all port numbers from root for the specified device

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Releases the device reference.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.