pub enum MemoryError {
DataTooLarge {
page_size: u64,
requested: u64,
},
DecodeError(DecodeError),
FailedToAllocatePage,
OutOfBounds,
SegmentationFault {
page: Page,
offset: PageOffset,
data_size: MSize,
page_size: u64,
},
StableMemoryError(String),
}Expand description
An enum representing possible memory-related errors.
Variants§
DataTooLarge
Error when the data to be written is too large for the page.
DecodeError(DecodeError)
Error when failing to decode data from bytes.
FailedToAllocatePage
Error when failing to allocate a new page.
OutOfBounds
Error when attempting to access stable memory out of bounds.
SegmentationFault
Error when attempting to write out of the allocated page.
StableMemoryError(String)
Error when failing to grow stable memory.
Trait Implementations§
Source§impl CandidType for MemoryError
impl CandidType for MemoryError
Source§impl Debug for MemoryError
impl Debug for MemoryError
Source§impl<'de> Deserialize<'de> for MemoryError
impl<'de> Deserialize<'de> for MemoryError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for MemoryError
impl Display 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 From<Error> for MemoryError
impl From<Error> for MemoryError
Source§impl From<FromUtf8Error> for MemoryError
impl From<FromUtf8Error> for MemoryError
Source§fn from(err: FromUtf8Error) -> Self
fn from(err: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<MemoryError> for IcDbmsError
impl From<MemoryError> for IcDbmsError
Source§fn from(source: MemoryError) -> Self
fn from(source: MemoryError) -> Self
Converts to this type from the input type.
Source§impl From<PrincipalError> for MemoryError
impl From<PrincipalError> for MemoryError
Source§fn from(err: PrincipalError) -> Self
fn from(err: PrincipalError) -> Self
Converts to this type from the input type.
Source§impl From<StableMemoryError> for MemoryError
impl From<StableMemoryError> for MemoryError
Source§fn from(err: StableMemoryError) -> Self
fn from(err: StableMemoryError) -> Self
Converts to this type from the input type.
Source§impl From<TryFromSliceError> for MemoryError
impl From<TryFromSliceError> for MemoryError
Source§fn from(err: TryFromSliceError) -> Self
fn from(err: TryFromSliceError) -> Self
Converts to this type from the input type.
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§
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