pub enum ErrorCause {
ParseError,
NonBlocksizeMultipleLengthError {
actual: usize,
block_size: usize,
},
UsbTransferError {
direction: UsbTransferDirection,
},
FlagError {
flags: u32,
},
BufferTooSmallError {
expected: usize,
actual: usize,
},
UnsupportedOperationError,
InvalidDeviceError,
}Expand description
The cause of a returned error. This is implemented as an enum with a large number of variants to reduce allocations.
Variants§
ParseError
The error was caused because the library failed to parse a byte buffer into a struct correctly.
NonBlocksizeMultipleLengthError
The error was caused because a passed-in byte length was not a multiple of the previously provided block size.
Fields
UsbTransferError
The error was caused because we failed to read/write enough bytes to/from the communication device.
Fields
direction: UsbTransferDirectionThe direction the failed transfer was in.
FlagError
The error was thrown because a struct’s flags were invalid.
BufferTooSmallError
The error was thrown becaused we attempted to read/write too many bytes from/to a buffer.
Fields
UnsupportedOperationError
The error was thrown because we called a method for a trait that isn’t valid in this particular struct’s implementation.
InvalidDeviceError
The error was thrown because we tried connecting to a device we don’t support.
Trait Implementations§
Source§impl Clone for ErrorCause
impl Clone for ErrorCause
Source§fn clone(&self) -> ErrorCause
fn clone(&self) -> ErrorCause
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more