devela::_dep::rkyv::validation

Trait ArchiveContextExt

pub trait ArchiveContextExt<E>: ArchiveContext<E> {
    // Required methods
    fn in_subtree_raw<R>(
        &mut self,
        ptr: *const u8,
        layout: Layout,
        f: impl FnOnce(&mut Self) -> Result<R, E>,
    ) -> Result<R, E> ;
    fn in_subtree<T, R>(
        &mut self,
        ptr: *const T,
        f: impl FnOnce(&mut Self) -> Result<R, E>,
    ) -> Result<R, E> 
       where T: LayoutRaw + ?Sized;
}
Available on crate feature dep_rkyv only.
Expand description

Helper methods for ArchiveContext.

Required Methods§

fn in_subtree_raw<R>( &mut self, ptr: *const u8, layout: Layout, f: impl FnOnce(&mut Self) -> Result<R, E>, ) -> Result<R, E>

Checks that the given pointer and layout are within the current subtree range of the context, then pushes a new subtree range onto the validator for it and calls the given function.

fn in_subtree<T, R>( &mut self, ptr: *const T, f: impl FnOnce(&mut Self) -> Result<R, E>, ) -> Result<R, E>
where T: LayoutRaw + ?Sized,

Checks that the value the given pointer points to is within the current subtree range of the context, then pushes a new subtree range onto the validator for it and calls the given function.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

§

impl<C, E> ArchiveContextExt<E> for C
where C: ArchiveContext<E> + ?Sized, E: Source,