Struct safe_transmute::error::GuardError[][src]

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

A slice boundary guard error, usually created by a Guard.

Examples

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

Fields

required: usize

The required amount of bytes for transmutation.

actual: usize

The actual amount of bytes.

reason: ErrorReason

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

Trait Implementations

impl Clone for GuardError[src]

impl Copy for GuardError[src]

impl Debug for GuardError[src]

impl Display for GuardError[src]

impl Eq for GuardError[src]

impl Error for GuardError[src]

impl<'a, S, T> From<GuardError> for Error<'a, S, T>[src]

impl Hash for GuardError[src]

impl PartialEq<GuardError> for GuardError[src]

impl StructuralEq for GuardError[src]

impl StructuralPartialEq for GuardError[src]

Auto Trait Implementations

impl RefUnwindSafe for GuardError

impl Send for GuardError

impl Sync for GuardError

impl Unpin for GuardError

impl UnwindSafe for GuardError

Blanket Implementations

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

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

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

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

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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> 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.