Struct rusb::HotplugBuilder[][src]

pub struct HotplugBuilder { /* fields omitted */ }
Expand description

Builds hotplug Registration with custom configuration values.

Implementations

Returns a new builder with the no filter Devices can optionally be filtered by HotplugBuilder::vendor_id and HotplugBuilder::product_id

Registration is done by by calling register.

Devices can optionally be filtered by vendor

Devices can optionally be filtered by product id

Devices can optionally be filtered by class

If enumerate is true, then devices that are already connected will cause your callback’s Hotplug::device_arrived method to be called for them.

Register a callback to be called on hotplug events. The callback’s Hotplug::device_arrived method is called when a new device is added to the bus, and Hotplug::device_left is called when it is removed.

The callback will remain registered until the returned Registration is dropped, which can be done explicitly with Context::unregister_callback.

When handling a Hotplug::device_arrived event it is considered safe to call any rusb function that takes a Device. It also safe to open a device and submit asynchronous transfers. However, most other functions that take a DeviceHandle are not safe to call. Examples of such functions are any of the synchronous API functions or the blocking functions that retrieve various USB descriptors. These functions must be used outside of the context of the Hotplug functions.

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

Returns the “default value” for a type. Read more

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

Performs the conversion.

Performs the conversion.

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)

recently added

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.