Struct rkyv::RawRelPtr [−][src]
#[repr(transparent)]pub struct RawRelPtr { /* fields omitted */ }
Expand description
An untyped pointer which resolves relative to its position in memory.
Implementations
impl RawRelPtr
[src]
impl RawRelPtr
[src]pub unsafe fn manual_check_bytes<'a, C: Fallible + ?Sized>(
value: *const RawRelPtr,
context: &mut C
) -> Result<&'a Self, Unreachable>
[src]
pub unsafe fn manual_check_bytes<'a, C: Fallible + ?Sized>(
value: *const RawRelPtr,
context: &mut C
) -> Result<&'a Self, Unreachable>
[src]Checks the bytes of the given raw relative pointer.
This is done rather than implementing CheckBytes
to force users to manually write their
CheckBytes
implementation since they need to also provide the ownership model of their
memory.
Safety
The caller must guarantee that the given pointer is aligned and points to enough bytes to
represent a RawRelPtr
.
impl RawRelPtr
[src]
impl RawRelPtr
[src]pub fn emplace(from: usize, to: usize, out: &mut MaybeUninit<Self>)
[src]
pub fn emplace(from: usize, to: usize, out: &mut MaybeUninit<Self>)
[src]Emplaces a new relative pointer between the given positions and stores it in the given output.
pub fn as_ptr(&self) -> *const ()
[src]
pub fn as_ptr(&self) -> *const ()
[src]Calculates the memory address being pointed to by this relative pointer.
pub fn as_mut_ptr(&mut self) -> *mut ()
[src]
pub fn as_mut_ptr(&mut self) -> *mut ()
[src]Returns an unsafe mutable pointer to the memory address being pointed to by this relative pointer.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for RawRelPtr
impl Send for RawRelPtr
impl Sync for RawRelPtr
impl !Unpin for RawRelPtr
impl UnwindSafe for RawRelPtr
Blanket Implementations
impl<T> ArchivePointee for T
[src]
impl<T> ArchivePointee for T
[src]type ArchivedMetadata = ()
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]
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> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more