devela::_dep::rkyv::validation

Trait SharedContext

pub trait SharedContext<E = <Self as Fallible>::Error> {
    // Required methods
    fn start_shared(
        &mut self,
        address: usize,
        type_id: TypeId,
    ) -> Result<ValidationState, E> ;
    fn finish_shared(
        &mut self,
        address: usize,
        type_id: TypeId,
    ) -> Result<(), E> ;
}
Available on crate feature dep_rkyv only.
Expand description

A context that can validate shared archive memory.

Shared pointers require this kind of context to validate.

Required Methods§

fn start_shared( &mut self, address: usize, type_id: TypeId, ) -> Result<ValidationState, E>

Starts validating the value associated with the given address.

Returns an error if the value associated with the given address was started with a different type ID.

fn finish_shared(&mut self, address: usize, type_id: TypeId) -> Result<(), E>

Finishes validating the value associated with the given address.

Returns an error if the given address was not pending.

Implementors§

§

impl<A, S, E> SharedContext<E> for Validator<A, S>
where S: SharedContext<E>,

§

impl<E> SharedContext<E> for SharedValidator
where E: Source,

§

impl<T, E> SharedContext<E> for Strategy<T, E>
where T: SharedContext<E>,