Trait rkyv_dyn::validation::DynContext[][src]

pub trait DynContext {
    unsafe fn check_rel_ptr_dyn(
        &mut self,
        base: *const u8,
        offset: isize
    ) -> Result<*const u8, Box<dyn Error>>;
unsafe fn bounds_check_ptr_dyn(
        &mut self,
        ptr: *const u8,
        layout: &Layout
    ) -> Result<(), Box<dyn Error>>;
unsafe fn claim_bytes_dyn(
        &mut self,
        start: *const u8,
        len: usize
    ) -> Result<(), Box<dyn Error>>;
unsafe fn claim_shared_bytes_dyn(
        &mut self,
        start: *const u8,
        len: usize,
        type_id: TypeId
    ) -> Result<bool, Box<dyn Error>>; }

A context that’s object safe and suitable for checking most types.

Required methods

unsafe fn check_rel_ptr_dyn(
    &mut self,
    base: *const u8,
    offset: isize
) -> Result<*const u8, Box<dyn Error>>
[src]

Checks the given parts of a relative pointer for bounds issues.

Safety

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

unsafe fn bounds_check_ptr_dyn(
    &mut self,
    ptr: *const u8,
    layout: &Layout
) -> Result<(), Box<dyn Error>>
[src]

Checks the given memory block for bounds issues.

Safety

The caller must guarantee that the pointer is inside the archive for this context.

unsafe fn claim_bytes_dyn(
    &mut self,
    start: *const u8,
    len: usize
) -> Result<(), Box<dyn Error>>
[src]

Claims count bytes located offset bytes away from base.

Safety

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

unsafe fn claim_shared_bytes_dyn(
    &mut self,
    start: *const u8,
    len: usize,
    type_id: TypeId
) -> Result<bool, Box<dyn 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...

Trait Implementations

impl ArchiveBoundsContext for dyn DynContext + '_[src]

impl ArchiveMemoryContext for dyn DynContext + '_[src]

impl Fallible for dyn DynContext + '_[src]

type Error = Box<dyn Error>

The error produced by any failing methods

impl SharedArchiveContext for dyn DynContext + '_[src]

Implementors

impl<C: ArchiveBoundsContext + ArchiveMemoryContext + SharedArchiveContext + ?Sized> DynContext for C where
    C::Error: Error
[src]

Loading content...