pub enum MemoryError {
Null,
WrongAlignment,
ShorterThanHeader,
MissingPadding,
InvalidReportedTotalSize,
}
Expand description
Errors that may occur when working with memory.
Variants§
Null
The memory points to null.
WrongAlignment
The memory must be at least ALIGNMENT
-aligned.
ShorterThanHeader
The memory must cover at least the length of the sized structure header type.
MissingPadding
The buffer misses the terminating padding to the next alignment boundary. The padding is relevant to satisfy Rustc/Miri, but also the spec mandates that the padding is added.
InvalidReportedTotalSize
The size-property has an illegal value that can’t be fulfilled with the given bytes.
Trait Implementations§
Source§impl Clone for MemoryError
impl Clone for MemoryError
Source§fn clone(&self) -> MemoryError
fn clone(&self) -> MemoryError
Returns a copy of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for MemoryError
impl Debug for MemoryError
Source§impl Display for MemoryError
impl Display for MemoryError
Source§impl Error for MemoryError
impl Error for MemoryError
1.30.0§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl Hash for MemoryError
impl Hash for MemoryError
Source§impl Ord for MemoryError
impl Ord for MemoryError
Source§impl PartialEq for MemoryError
impl PartialEq for MemoryError
Source§impl PartialOrd for MemoryError
impl PartialOrd for MemoryError
Source§fn partial_cmp(&self, other: &MemoryError) -> Option<Ordering>
fn partial_cmp(&self, other: &MemoryError) -> Option<Ordering>
impl Copy for MemoryError
impl Eq for MemoryError
impl StructuralPartialEq for MemoryError
Auto Trait Implementations§
impl Freeze for MemoryError
impl RefUnwindSafe for MemoryError
impl Send for MemoryError
impl Sync for MemoryError
impl Unpin for MemoryError
impl UnwindSafe for MemoryError
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dst: *mut u8)
unsafe fn clone_to_uninit(&self, dst: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)