usb_if/
err.rs

1use alloc::{boxed::Box, string::String};
2
3#[derive(thiserror::Error, Debug)]
4pub enum TransferError {
5    #[error("Stall")]
6    Stall,
7    #[error("Request queue full")]
8    RequestQueueFull,
9    #[error("Other error: {0}")]
10    Other(String),
11}
12
13impl From<Box<dyn core::error::Error>> for TransferError {
14    fn from(err: Box<dyn core::error::Error>) -> Self {
15        TransferError::Other(alloc::format!("{err}"))
16    }
17}
18/*
19
20LIBUSB_SUCCESS
21Success (no error)
22
23LIBUSB_ERROR_IO
24Input/output error.
25
26LIBUSB_ERROR_INVALID_PARAM
27Invalid parameter.
28
29LIBUSB_ERROR_ACCESS
30Access denied (insufficient permissions)
31
32LIBUSB_ERROR_NO_DEVICE
33No such device (it may have been disconnected)
34
35LIBUSB_ERROR_NOT_FOUND
36Entity not found.
37
38LIBUSB_ERROR_BUSY
39Resource busy.
40
41LIBUSB_ERROR_TIMEOUT
42Operation timed out.
43
44LIBUSB_ERROR_OVERFLOW
45Overflow.
46
47LIBUSB_ERROR_PIPE
48Pipe error.
49
50LIBUSB_ERROR_INTERRUPTED
51System call interrupted (perhaps due to signal)
52
53LIBUSB_ERROR_NO_MEM
54Insufficient memory.
55
56LIBUSB_ERROR_NOT_SUPPORTED
57Operation not supported or unimplemented on this platform.
58
59LIBUSB_ERROR_OTHER
60Other error.
61*/