Enum rkyv::validation::validators::ArchiveError[][src]

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,
    },
}
Expand description

Errors that can occur when checking archive memory.

Variants

Overflow

Computing the target of a relative pointer overflowed

Show fields

Fields of Overflow

base: *const u8

The base pointer

offset: isize

The offset

Underaligned

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

Show fields

Fields of Underaligned

expected_align: usize

The expected alignment of the archive

actual_align: usize

The actual alignment of the archive

OutOfBounds

A pointer pointed outside the bounds of the archive

Show fields

Fields of OutOfBounds

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

Overrun

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

Show fields

Fields of Overrun

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

Unaligned

The pointer wasn’t aligned properly for the desired type

Show fields

Fields of Unaligned

ptr: *const u8

The pointer to the type

align: usize

The required alignment of the type

SubtreePointerOutOfBounds

The pointer wasn’t within the subtree range

Show fields

Fields of SubtreePointerOutOfBounds

ptr: *const u8

The pointer to the subtree

subtree_range: Range<*const u8>

The subtree range

SubtreePointerOverrun

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

Show fields

Fields of SubtreePointerOverrun

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

RangePoppedOutOfOrder

A subtree range was popped out of order.

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

Show fields

Fields of RangePoppedOutOfOrder

expected_depth: usize

The expected depth of the range

actual_depth: usize

The actual depth of the range

UnpoppedSubtreeRanges

A subtree range was not popped before validation concluded.

Show fields

Fields of UnpoppedSubtreeRanges

last_range: usize

The depth of the last subtree that was pushed

ExceededMaximumSubtreeDepth

The maximum subtree depth was reached or exceeded.

Show fields

Fields of ExceededMaximumSubtreeDepth

max_subtree_depth: usize

The maximum depth that subtrees may be validated down to

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

The lower-level source of this error, if any. Read more

🔬 This is a nightly-only experimental API. (backtrace)

Returns a stack backtrace, if available, of where this error occurred. Read more

👎 Deprecated since 1.42.0:

use the Display impl or to_string()

👎 Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

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

Performs the conversion.

Performs the conversion.

Gets the layout of the type.

The type for metadata in pointers and references to Self.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.