Trait rkyv::CheckBytes
source · pub trait CheckBytes<C>where
C: ?Sized,{
type Error: Error + 'static;
// Required method
unsafe fn check_bytes<'a>(
value: *const Self,
context: &mut C,
) -> Result<&'a Self, Self::Error>;
}
Expand description
A type that can check whether a pointer points to a valid value.
CheckBytes
can be derived with CheckBytes
or
implemented manually for custom behavior.
Required Associated Types§
Required Methods§
sourceunsafe fn check_bytes<'a>(
value: *const Self,
context: &mut C,
) -> Result<&'a Self, Self::Error>
unsafe fn check_bytes<'a>( value: *const Self, context: &mut C, ) -> Result<&'a Self, Self::Error>
Checks whether the given pointer points to a valid value within the given context.
§Safety
The passed pointer must be aligned and point to enough bytes to represent the type.
Object Safety§
This trait is not object safe.