Skip to main content

MemoryError

Enum MemoryError 

Source
pub enum MemoryError {
Show 15 variants AclLayoutUnsupported, AutoincrementOverflow(String), ConstraintViolation(String), DataTooLarge { page_size: u64, requested: u64, }, DecodeError(DecodeError), FailedToAllocatePage, UnclaimedPagesFull { capacity: u32, }, IndexNotFound(Vec<String>), NameCollision { candidate: String, existing: String, }, EntryNotFound, KeyTooLarge { size: u64, max: u64, }, OffsetNotAligned { offset: u16, alignment: u16, }, OutOfBounds, SegmentationFault { page: u32, offset: u16, data_size: u64, page_size: u64, }, ProviderError(String),
}
Expand description

An enum representing possible memory-related errors.

Variants§

§

AclLayoutUnsupported

Error when the persisted ACL page carries an unsupported layout version. Returned by crate::dbms::acl decoders.

§

AutoincrementOverflow(String)

Error when an autoincrement column has reached its maximum value.

§

ConstraintViolation(String)

Error when a constraint prevents the requested operation.

§

DataTooLarge

Error when the data to be written is too large for the page.

Fields

§page_size: u64
§requested: u64
§

DecodeError(DecodeError)

Error when failing to decode data from bytes.

§

FailedToAllocatePage

Error when failing to allocate a new page.

§

UnclaimedPagesFull

Error when the unclaimed-pages ledger has no room for another entry.

Fields

§capacity: u32

Maximum number of pages the ledger can hold.

§

IndexNotFound(Vec<String>)

Error when no index exists for the requested columns.

§

NameCollision

Error when registering a table whose name hash collides with an already-registered table of a different name.

Fields

§candidate: String

Name of the table being registered.

§existing: String

Name of the already-registered table that produced the same hash.

§

EntryNotFound

Error when an index entry cannot be located.

§

KeyTooLarge

Error when a single key cannot fit into a node page.

Fields

§size: u64
§max: u64
§

OffsetNotAligned

Fields

§offset: u16
§alignment: u16
§

OutOfBounds

Error when attempting to access stable memory out of bounds.

§

SegmentationFault

Error when attempting to write out of the allocated page.

Fields

§page: u32
§offset: u16
§data_size: u64
§page_size: u64
§

ProviderError(String)

Error from the underlying memory provider.

Trait Implementations§

Source§

impl CandidType for MemoryError

Source§

fn _ty() -> Type

Source§

fn _ty_doc() -> TypeDoc

Source§

fn id() -> TypeId

Source§

fn idl_serialize<__S>( &self, __serializer: __S, ) -> Result<(), <__S as Serializer>::Error>
where __S: Serializer,

Source§

fn ty() -> Type

Source§

impl Debug for MemoryError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for MemoryError

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<MemoryError, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for MemoryError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Error for MemoryError

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<Error> for MemoryError

Source§

fn from(err: Error) -> MemoryError

Converts to this type from the input type.
Source§

impl From<FromUtf8Error> for MemoryError

Source§

fn from(err: FromUtf8Error) -> MemoryError

Converts to this type from the input type.
Source§

impl From<MemoryError> for DbmsError

Source§

fn from(source: MemoryError) -> DbmsError

Converts to this type from the input type.
Source§

impl From<TryFromSliceError> for MemoryError

Source§

fn from(err: TryFromSliceError) -> MemoryError

Converts to this type from the input type.
Source§

impl Serialize for MemoryError

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,