Struct safe_transmute::Error [] [src]

pub struct Error {
    pub required: usize,
    pub actual: usize,
    pub reason: ErrorReason,
}

A transmutation error.

Examples

assert_eq!(guarded_transmute::<u16>(&[0x00]),
           Err(Error {
               required: 16 / 8,
               actual: 1,
               reason: ErrorReason::NotEnoughBytes,
           }));

Fields

The required amount of bytes for transmutation.

The actual amount of bytes.

Why this required/actual/T combo is an error.

Trait Implementations

impl Clone for Error
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Error
[src]

impl Debug for Error
[src]

Formats the value using the given formatter.

impl PartialEq for Error
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Eq for Error
[src]

impl Hash for Error
[src]

Feeds this value into the given [Hasher]. Read more

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

impl StdError for Error
[src]

A short description of the error. Read more

The lower-level cause of this error, if any. Read more

impl Display for Error
[src]

Formats the value using the given formatter. Read more