Skip to main content

ArchiveContextExt

Trait ArchiveContextExt 

Source
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: LayoutRaw + ?Sized, R>(
        &mut self,
        ptr: *const T,
        f: impl FnOnce(&mut Self) -> Result<R, E>,
    ) -> Result<R, E>;
}
Expand description

Helper methods for ArchiveContext.

Required Methods§

Source

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.

Source

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

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§