Struct rkyv::RawRelPtr [−][src]
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]
value: *const RawRelPtr,
context: &mut C
) -> Result<&'a Self, Unreachable>
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 new(from: usize, to: usize) -> Self
[src]
Creates a new relative pointer between the given positions.
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
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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]
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
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> Pointee for T
[src]
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>,