This crate provides a safe wrapper around the native
libusb library. It applies the RAII pattern
and Rust lifetimes to ensure safe usage of all
libusb functionality. The RAII pattern ensures that
all acquired resources are released when they're no longer needed, and Rust lifetimes ensure that
resources are released in a proper order.
To use rusb no extra setup is required as rusb will automatically download the source for libusb and build it.
However if building libusb fails you can also try setting up the native
libusb library where it can
be found by
All systems supported by the native
libusb library are also supported by the
libusb crate. It's
been tested on Linux, OS X, and Windows.
rusb crate can be used when cross-compiling to a foreign target. Details on how to
rusb are explained in the
rusb as a dependency in
 = "0.9"
rusb crate. The starting point for nearly all
rusb functionality is to create a
context object. With a context object, you can list devices, read their descriptors, open them, and
communicate with their endpoints:
Distributed under the MIT License.
If you link native
libusb (by example using
vendored features) library statically then
you must follow GNU LGPL from libusb.