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
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 Error
[src]
fn clone(&self) -> Error
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Copy for Error
[src]
impl Debug for Error
[src]
impl PartialEq for Error
[src]
fn eq(&self, __arg_0: &Error) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Error) -> bool
This method tests for !=
.
impl Eq for Error
[src]
impl Hash for Error
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl StdError for Error
[src]
fn description(&self) -> &str
A short description of the error. Read more
fn cause(&self) -> Option<&Error>
1.0.0
The lower-level cause of this error, if any. Read more