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>
, { ... } }

A context that can validate shared archive memory.

Shared pointers require this kind of context to validate.

Required methods

unsafe fn claim_shared_bytes(
    &mut self,
    start: *const u8,
    len: usize,
    type_id: TypeId
) -> Result<bool, Self::Error>
[src]

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.

Loading content...

Provided methods

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>, 
[src]

Claims the memory referenced by the given relative pointer.

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

Loading content...

Implementors

impl<C: ArchiveMemoryContext> SharedArchiveContext for SharedArchiveValidator<C>[src]

Loading content...