pub enum ArchiveError {
    Overflow {
        base: *const u8,
        offset: isize,
    },
    Underaligned {
        expected_align: usize,
        actual_align: usize,
    },
    OutOfBounds {
        base: *const u8,
        offset: isize,
        range: Range<*const u8>,
    },
    Overrun {
        ptr: *const u8,
        size: usize,
        range: Range<*const u8>,
    },
    Unaligned {
        ptr: *const u8,
        align: usize,
    },
    SubtreePointerOutOfBounds {
        ptr: *const u8,
        subtree_range: Range<*const u8>,
    },
    SubtreePointerOverrun {
        ptr: *const u8,
        size: usize,
        subtree_range: Range<*const u8>,
    },
    RangePoppedOutOfOrder {
        expected_depth: usize,
        actual_depth: usize,
    },
    UnpoppedSubtreeRanges {
        last_range: usize,
    },
    ExceededMaximumSubtreeDepth {
        max_subtree_depth: usize,
    },
    LayoutError {
        layout_error: LayoutError,
    },
}
Expand description

Errors that can occur when checking archive memory.

Variants§

§

Overflow

Fields

§base: *const u8

The base pointer

§offset: isize

The offset

Computing the target of a relative pointer overflowed

§

Underaligned

Fields

§expected_align: usize

The expected alignment of the archive

§actual_align: usize

The actual alignment of the archive

The archive is under-aligned for one of the types inside

§

OutOfBounds

Fields

§base: *const u8

The base of the relative pointer

§offset: isize

The offset of the relative pointer

§range: Range<*const u8>

The pointer range of the archive

A pointer pointed outside the bounds of the archive

§

Overrun

Fields

§ptr: *const u8

The pointer to the type

§size: usize

The desired size of the type

§range: Range<*const u8>

The pointer range of the archive

There wasn’t enough space for the desired type at the pointed location

§

Unaligned

Fields

§ptr: *const u8

The pointer to the type

§align: usize

The required alignment of the type

The pointer wasn’t aligned properly for the desired type

§

SubtreePointerOutOfBounds

Fields

§ptr: *const u8

The pointer to the subtree

§subtree_range: Range<*const u8>

The subtree range

The pointer wasn’t within the subtree range

§

SubtreePointerOverrun

Fields

§ptr: *const u8

The pointer to the subtree type,

§size: usize

The desired size of the type

§subtree_range: Range<*const u8>

The subtree range

There wasn’t enough space in the subtree range for the desired type at the pointed location

§

RangePoppedOutOfOrder

Fields

§expected_depth: usize

The expected depth of the range

§actual_depth: usize

The actual depth of the range

A subtree range was popped out of order.

Subtree ranges must be popped in the reverse of the order they are pushed.

§

UnpoppedSubtreeRanges

Fields

§last_range: usize

The depth of the last subtree that was pushed

A subtree range was not popped before validation concluded.

§

ExceededMaximumSubtreeDepth

Fields

§max_subtree_depth: usize

The maximum depth that subtrees may be validated down to

The maximum subtree depth was reached or exceeded.

§

LayoutError

Fields

§layout_error: LayoutError

A layout error

A layout error occurred

Trait Implementations§

source§

impl Debug for ArchiveError

source§

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

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

impl Display for ArchiveError

source§

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

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

impl Error for ArchiveError

1.30.0 · source§

fn source(&self) -> Option<&(dyn Error + 'static)>

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, demand: &mut Demand<'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 Send for ArchiveError

source§

impl Sync for ArchiveError

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

source§

fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> Error for Twhere T: Error + 'static,

source§

fn as_error(&self) -> &(dyn Error + 'static)

Gets this error as an std::error::Error.
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> LayoutRaw for T

source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
source§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
source§

impl<E> Provider for Ewhere E: Error + ?Sized,

source§

fn provide<'a>(&'a self, demand: &mut Demand<'a>)

🔬This is a nightly-only experimental API. (provide_any)
Data providers should implement this method to provide all values they are able to provide by using demand. Read more
source§

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

source§

default fn to_string(&self) -> String

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

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.