Struct rkyv::validation::SharedArchiveValidator[][src]

pub struct SharedArchiveValidator<C> { /* fields omitted */ }

An adapter that adds shared memory validation.

Implementations

impl<C> SharedArchiveValidator<C>[src]

pub fn new(inner: C) -> Self[src]

Wraps the given context and adds shared memory validation.

pub fn into_inner(self) -> C[src]

Consumes the adapter and returns the underlying validator.

Trait Implementations

impl<C: ArchiveBoundsContext> ArchiveBoundsContext for SharedArchiveValidator<C>[src]

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

Checks the given parts of a relative pointer for bounds issues Read more

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

Checks the given memory block for bounds issues. Read more

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

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

Claims count bytes located offset bytes away from base. Read more

unsafe fn claim_owned_ptr<T: ArchivePointee + ?Sized>(
    &mut self,
    ptr: *const T
) -> Result<(), Self::Error> where
    Self: ArchiveBoundsContext,
    <T as Pointee>::Metadata: LayoutMetadata<T>, 
[src]

Claims the memory at the given location as the given type. Read more

fn claim_owned_rel_ptr<T: ArchivePointee + ?Sized>(
    &mut self,
    rel_ptr: &RelPtr<T>
) -> Result<*const T, Self::Error> where
    Self: ArchiveBoundsContext,
    <T as Pointee>::Metadata: LayoutMetadata<T>, 
[src]

Claims the memory referenced by the given relative pointer.

impl<C: Fallible> Fallible for SharedArchiveValidator<C>[src]

type Error = SharedArchiveError<C::Error>

The error produced by any failing methods

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

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. Read more

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. Read more

Auto Trait Implementations

impl<C> RefUnwindSafe for SharedArchiveValidator<C> where
    C: RefUnwindSafe

impl<C> !Send for SharedArchiveValidator<C>

impl<C> !Sync for SharedArchiveValidator<C>

impl<C> Unpin for SharedArchiveValidator<C> where
    C: Unpin

impl<C> UnwindSafe for SharedArchiveValidator<C> where
    C: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> ArchivePointee for T[src]

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.

pub fn pointer_metadata(
    &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
[src]

Converts some archived metadata to the pointer metadata for itself.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointee for T[src]

type Metadata = ()

The type for metadata in pointers and references to Self.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.