Trait rkyv::validation::SharedArchiveContext[][src]

pub trait SharedArchiveContext: Fallible {
    unsafe fn claim_shared_bytes(
        &mut self,
        start: *const u8,
        len: usize,
        type_id: TypeId
    ) -> Result<bool, Self::Error>; fn claim_shared_ptr<T: ArchivePointee + CheckBytes<Self> + ?Sized>(
        &mut self,
        rel_ptr: &RelPtr<T>,
        type_id: TypeId
    ) -> Result<Option<*const T>, Self::Error>
    where
        Self: ArchiveBoundsContext,
        <T as Pointee>::Metadata: LayoutMetadata<T>
, { ... } }
Expand description

A context that can validate shared archive memory.

Shared pointers require this kind of context to validate.

Required methods

Claims count shared bytes located offset bytes away from base.

Returns whether the bytes need to be checked.

Safety

The caller must guarantee that base is inside the archive this context was created for.

Provided methods

Claims the memory referenced by the given relative pointer.

If the pointer needs to be checked, returns Some with the pointer to check.

Implementors