pub struct UsbDeviceBuilder<'a, B: UsbBus> { /* private fields */ }
Expand description

Used to build new UsbDevices.

Implementations

Creates a builder for constructing a new UsbDevice.

Creates the UsbDevice instance with the configuration in this builder.

Sets the device class code assigned by USB.org. Set to 0xff for vendor-specific devices that do not conform to any class.

Default: 0x00 (class code specified by interfaces)

Sets the device sub-class code. Depends on class.

Default: 0x00

Sets the device protocol code. Depends on class and sub-class.

Default: 0x00

Sets the device release version in BCD.

Default: 0x0010 (“0.1”)

Sets whether the device may have an external power source.

This should be set to true even if the device is sometimes self-powered and may not always draw power from the USB bus.

Default: false

See also: max_power

Sets whether the device supports remotely waking up the host is requested.

Default: false

Configures the device as a composite device with interface association descriptors.

Sets the manufacturer name string descriptor.

Default: (none)

Sets the product name string descriptor.

Default: (none)

Sets the serial number string descriptor.

Default: (none)

Sets the maximum packet size in bytes for the control endpoint 0.

Valid values are 8, 16, 32 and 64. There’s generally no need to change this from the default value of 8 bytes unless a class uses control transfers for sending large amounts of data, in which case using a larger packet size may be more efficient.

Default: 8 bytes

Sets the maximum current drawn from the USB bus by the device in milliamps.

The default is 100 mA. If your device always uses an external power source and never draws power from the USB bus, this can be set to 0.

See also: self_powered

Default: 100mA

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 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.