Struct rkyv::RawRelPtr[][src]

#[repr(transparent)]
pub struct RawRelPtr { /* fields omitted */ }

An untyped pointer which resolves relative to its position in memory.

Implementations

impl RawRelPtr[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]

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 null() -> Self[src]

Creates a new relative pointer that has an offset of 0.

pub fn is_null(&self) -> bool[src]

Checks whether the relative pointer is null.

pub fn base(&self) -> *const u8[src]

Gets the base pointer for the relative pointer.

pub fn offset(&self) -> isize[src]

Gets the offset of the relative pointer.

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]

Returns an unsafe mutable pointer to the memory address being pointed to by this relative pointer.

Trait Implementations

impl Debug for RawRelPtr[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

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.