Struct rusb::Context

source ·
pub struct Context { /* private fields */ }
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 ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
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.
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.
Interrupt any active thread that is handling events (for example with handle_events).

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