[][src]Struct rkyv::RelPtr

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

A pointer which resolves to relative to its position in memory.

See Archive for an example of creating one.

Implementations

impl RelPtr[src]

pub unsafe fn new(from: usize, to: usize) -> Self[src]

Creates a relative pointer from one position to another.

Safety

from must be the position of the relative pointer and to must be the position of some valid memory.

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

Gets the offset of the relative pointer.

pub fn as_ptr<T>(&self) -> *const T[src]

Calculates the memory address being pointed to by this relative pointer.

pub fn as_mut_ptr<T>(&mut self) -> *mut T[src]

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

Trait Implementations

impl CheckBytes<ArchiveContext> for RelPtr[src]

type Error = Unreachable

The error that may result from validating the type.

impl Debug for RelPtr[src]

Auto Trait Implementations

impl RefUnwindSafe for RelPtr

impl Send for RelPtr

impl Sync for RelPtr

impl !Unpin for RelPtr

impl UnwindSafe for RelPtr

Blanket Implementations

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

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

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

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

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

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.

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.