[][src]Enum scsi::ErrorCause

pub enum ErrorCause {
    ParseError,
    NonBlocksizeMultipleLengthError {
        actual: usize,
        block_size: usize,
    },
    UsbTransferError {
        direction: UsbTransferDirection,
    },
    FlagError {
        flags: u32,
    },
    BufferTooSmallError {
        expected: usize,
        actual: usize,
    },
    UnsupportedOperationError,
    InvalidDeviceError,
}

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 of NonBlocksizeMultipleLengthError

actual: usize

The transfer length that was passed in, but was rejected because actual % block_size != 0.

block_size: usize

The expected block size.

UsbTransferError

The error was caused because we failed to read/write enough bytes to/from the communication device.

Fields of UsbTransferError

direction: UsbTransferDirection

The direction the failed transfer was in.

FlagError

The error was thrown because a struct's flags were invalid.

Fields of FlagError

flags: u32

The value of whatever flag that was rejected.

BufferTooSmallError

The error was thrown becaused we attempted to read/write too many bytes from/to a buffer.

Fields of BufferTooSmallError

expected: usize

The size of the buffer the read/write expected.

actual: usize

The actual size of the buffer.

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

impl PartialEq<ErrorCause> for ErrorCause[src]

impl Eq for ErrorCause[src]

impl Hash for ErrorCause[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl Copy for ErrorCause[src]

impl Debug for ErrorCause[src]

impl Clone for ErrorCause[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

impl Send for ErrorCause

impl Sync for ErrorCause

Blanket Implementations

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]