1use std::time::Duration;
2pub mod descriptors;
3pub mod endpoint;
4pub mod os;
5pub mod usb_transfer;
6pub use endpoint::{Endpoint, ENDPOINT_IN, ENDPOINT_OUT};
7#[cfg(target_os = "linux")]
8pub use os::linux::constants::*;
9#[cfg(target_os = "linux")]
10pub use os::linux::enumerate::UsbEnumerate;
11#[cfg(target_os = "linux")]
12pub use os::linux::usb_device::UsbDevice;
13#[cfg(target_os = "linux")]
14pub use os::linux::usbfs::UsbFs as UsbCore;
15pub use usb_transfer::{BufferSlice, BulkTransfer, ControlTransfer, TransferKind, UsbCoreDriver};
16
17#[derive(Debug, Clone)]
18pub struct TimeoutMillis(u32);
19impl From<u32> for TimeoutMillis {
20 fn from(timeout_ms: u32) -> Self {
21 Self { 0: timeout_ms }
22 }
23}
24
25impl From<Duration> for TimeoutMillis {
26 fn from(duration: Duration) -> Self {
27 Self {
28 0: duration.as_millis() as u32,
29 }
30 }
31}