pub enum MemoryError {
Uninitialised {
addr: i64,
},
Misaligned {
addr: i64,
},
NotAByte {
value: i64,
},
Device {
addr: i64,
reason: &'static str,
},
AddressOverflow {
addr: i64,
len: i64,
},
}Expand description
Something went wrong with a memory access.
Variants§
Uninitialised
Read of memory that was never written.
Misaligned
Access not aligned to a word boundary.
NotAByte
A tryte outside 0..=255 was written to a byte-oriented device (D-04).
Device
A device rejected the access.
AddressOverflow
The access would run off the end of the address space.
Implementations§
Source§impl MemoryError
impl MemoryError
Sourcepub fn overshoot(&self) -> Option<i64>
pub fn overshoot(&self) -> Option<i64>
For an AddressOverflow, how many
trytes past the end of the address space the access would have reached.
None for the other variants.
Trait Implementations§
Source§impl Clone for MemoryError
impl Clone for MemoryError
Source§fn clone(&self) -> MemoryError
fn clone(&self) -> MemoryError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for MemoryError
Source§impl Debug for MemoryError
impl Debug for MemoryError
Source§impl Display for MemoryError
impl Display for MemoryError
impl Eq for MemoryError
Source§impl Error for MemoryError
impl Error for MemoryError
1.30.0 · Source§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 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl PartialEq for MemoryError
impl PartialEq for MemoryError
Source§fn eq(&self, other: &MemoryError) -> bool
fn eq(&self, other: &MemoryError) -> bool
Tests for
self and other values to be equal, and is used by ==.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 UnsafeUnpin for MemoryError
impl UnwindSafe for MemoryError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more