usbw 0.0.2

basic USB driver. So far just a wrapper for `rusb`. Planning on wrapping `libusb` later
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub fn main() -> Result<(), usbw::libusb::error::Error> {
    println!("start");
    let context = usbw::libusb::context::Context::new()?;
    context.hotplug_register_callback(
        |_context, d, e| {
            println!("{:?} {:?}", d, e);
            true
        },
        usbw::libusb::hotplug::Event::Both,
        usbw::libusb::hotplug::Flags::Enumerate,
        None,
        None,
        None,
    )?;
    loop {
        context.handle_events()?;
    }
}