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]
&mut self,
base: *const u8,
offset: isize
) -> Result<*const u8, Box<dyn Error>>
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]
&mut self,
ptr: *const u8,
layout: &Layout
) -> Result<(), Box<dyn Error>>
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]
&mut self,
start: *const u8,
len: usize
) -> Result<(), Box<dyn Error>>
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]
&mut self,
start: *const u8,
len: usize,
type_id: TypeId
) -> Result<bool, Box<dyn Error>>
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.
Trait Implementations
impl ArchiveBoundsContext for dyn DynContext + '_
[src]
impl ArchiveBoundsContext for dyn DynContext + '_
[src]impl ArchiveMemoryContext for dyn DynContext + '_
[src]
impl ArchiveMemoryContext for dyn DynContext + '_
[src]unsafe fn claim_bytes(
&mut self,
start: *const u8,
len: usize
) -> Result<(), Self::Error>
[src]
&mut self,
start: *const u8,
len: usize
) -> Result<(), Self::Error>
pub unsafe fn claim_owned_ptr<T>(
&mut self,
ptr: *const T
) -> Result<(), Self::Error> where
Self: ArchiveBoundsContext,
T: ArchivePointee + ?Sized,
<T as Pointee>::Metadata: LayoutMetadata<T>,
[src]
&mut self,
ptr: *const T
) -> Result<(), Self::Error> where
Self: ArchiveBoundsContext,
T: ArchivePointee + ?Sized,
<T as Pointee>::Metadata: LayoutMetadata<T>,
pub fn claim_owned_rel_ptr<T>(
&mut self,
rel_ptr: &RelPtr<T>
) -> Result<*const T, Self::Error> where
Self: ArchiveBoundsContext,
T: ArchivePointee + ?Sized,
<T as Pointee>::Metadata: LayoutMetadata<T>,
[src]
&mut self,
rel_ptr: &RelPtr<T>
) -> Result<*const T, Self::Error> where
Self: ArchiveBoundsContext,
T: ArchivePointee + ?Sized,
<T as Pointee>::Metadata: LayoutMetadata<T>,
impl Fallible for dyn DynContext + '_
[src]
impl Fallible for dyn DynContext + '_
[src]impl SharedArchiveContext for dyn DynContext + '_
[src]
impl SharedArchiveContext for dyn DynContext + '_
[src]unsafe fn claim_shared_bytes(
&mut self,
start: *const u8,
len: usize,
type_id: TypeId
) -> Result<bool, Box<dyn Error>>
[src]
&mut self,
start: *const u8,
len: usize,
type_id: TypeId
) -> Result<bool, Box<dyn Error>>
pub fn claim_shared_ptr<T>(
&mut self,
rel_ptr: &RelPtr<T>,
type_id: TypeId
) -> Result<Option<*const T>, Self::Error> where
Self: ArchiveBoundsContext,
T: ArchivePointee + CheckBytes<Self> + ?Sized,
<T as Pointee>::Metadata: LayoutMetadata<T>,
[src]
&mut self,
rel_ptr: &RelPtr<T>,
type_id: TypeId
) -> Result<Option<*const T>, Self::Error> where
Self: ArchiveBoundsContext,
T: ArchivePointee + CheckBytes<Self> + ?Sized,
<T as Pointee>::Metadata: LayoutMetadata<T>,
Implementors
impl<C: ArchiveBoundsContext + ArchiveMemoryContext + SharedArchiveContext + ?Sized> DynContext for C where
C::Error: Error,
[src]
impl<C: ArchiveBoundsContext + ArchiveMemoryContext + SharedArchiveContext + ?Sized> DynContext for C where
C::Error: Error,
[src]unsafe fn check_rel_ptr_dyn(
&mut self,
base: *const u8,
offset: isize
) -> Result<*const u8, Box<dyn Error>>
[src]
&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>>
[src]
&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>>
[src]
&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>>
[src]
&mut self,
start: *const u8,
len: usize,
type_id: TypeId
) -> Result<bool, Box<dyn Error>>