pub enum PodCastError {
TargetAlignmentGreaterAndInputNotAligned,
OutputSliceWouldHaveSlop,
SizeMismatch,
AlignmentMismatch,
}Expand description
The things that can go wrong when casting between Pod data forms.
Variants§
TargetAlignmentGreaterAndInputNotAligned
You tried to cast a reference into a reference to a type with a higher alignment requirement but the input reference wasn’t aligned.
OutputSliceWouldHaveSlop
If the element size of a slice changes, then the output slice changes length accordingly. If the output slice wouldn’t be a whole number of elements, then the conversion fails.
SizeMismatch
When casting an individual T, &T, or &mut T value the
source size and destination size must be an exact match.
AlignmentMismatch
For this type of cast the alignments must be exactly the same and they were not so now you’re sad.
This error is generated only by operations that cast allocated types
(such as Box and Vec), because in that case the alignment must stay
exact.
Trait Implementations§
Source§impl Clone for PodCastError
impl Clone for PodCastError
Source§fn clone(&self) -> PodCastError
fn clone(&self) -> PodCastError
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PodCastError
impl Debug for PodCastError
Source§impl Display for PodCastError
Available on non-SPIR-V only.
impl Display for PodCastError
Source§impl Error for PodCastError
Available on crate feature impl_core_error and non-crate feature extern_crate_std only.
impl Error for PodCastError
impl_core_error and non-crate feature extern_crate_std only.1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()