Struct rusb::Context[][src]

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

A libusb context.

Implementations

Opens a new libusb context.

Creates a new libusb context and sets runtime options.

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

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

This method tests for !=.

Get the raw libusb_context pointer, for advanced use in unsafe code.

Returns a list of the current USB devices.

Convenience function to open a device by its vendor ID and product ID. Read more

Opens the device with a pre-opened file descriptor. Read more

Sets the log level of a libusb for context.

👎 Deprecated since 0.9.0:

Use HotplugBuilder

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

Unregisters the callback corresponding to the given registration. The same thing can be achieved by dropping the registration. Read more

Handle any pending events. If timeout less then 1 microseconds then this function will handle any already-pending events and then immediately return in non-blocking style. If timeout is None then function will handle any pending events in blocking mode. Read more

Interrupt any active thread that is handling events (for example with handle_events). 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.