[−][src]Struct rkyv::RelPtr
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.
pub unsafe fn check_bytes<'a>(
bytes: *const u8,
context: &mut ArchiveContext
) -> Result<&'a Self, Self::Error>
[src]
bytes: *const u8,
context: &mut ArchiveContext
) -> Result<&'a Self, Self::Error>
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,