Struct rkyv::rel_ptr::RelPtr [−][src]
pub struct RelPtr<T: ArchivePointee + ?Sized, O> { /* fields omitted */ }Expand description
Implementations
Attempts to create a relative pointer from one position to another.
Safety
frommust be the position ofoutwithin the archivetomust be the position of some validT
Attempts to create a null relative pointer with default metadata.
Safety
pos must be the position of out within the archive.
pub unsafe fn try_resolve_emplace<U: ArchiveUnsized<Archived = T> + ?Sized>(
from: usize,
to: usize,
value: &U,
metadata_resolver: U::MetadataResolver,
out: *mut Self
) -> Result<(), OffsetError>
pub unsafe fn try_resolve_emplace<U: ArchiveUnsized<Archived = T> + ?Sized>(
from: usize,
to: usize,
value: &U,
metadata_resolver: U::MetadataResolver,
out: *mut Self
) -> Result<(), OffsetError>
Attempts to create a relative pointer from one position to another.
Safety
frommust be the position ofoutwithin the archivetomust be the position of some validTvaluemust be the value being serializedmetadata_resolvermust be the result of serializing the metadata ofvalue
pub unsafe fn resolve_emplace<U: ArchiveUnsized<Archived = T> + ?Sized>(
from: usize,
to: usize,
value: &U,
metadata_resolver: U::MetadataResolver,
out: *mut Self
)
pub unsafe fn resolve_emplace<U: ArchiveUnsized<Archived = T> + ?Sized>(
from: usize,
to: usize,
value: &U,
metadata_resolver: U::MetadataResolver,
out: *mut Self
)
Creates a relative pointer from one position to another.
Panics
- The offset between
fromandtodoes not fit in anisize - The offset between
fromandtoexceeds the offset storage
Safety
frommust be the position ofoutwithin the archivetomust be the position of some validTvaluemust be the value being serializedmetadata_resolvermust be the result of serializing the metadata ofvalue
Gets the metadata of the relative pointer.
Calculates the memory address being pointed to by this relative pointer.
Returns an unsafe mutable pointer to the memory address being pointed to by this relative pointer.
Trait Implementations
impl<T: ArchivePointee + ?Sized, O: Debug> Debug for RelPtr<T, O> where
T::ArchivedMetadata: Debug,
impl<T: ArchivePointee + ?Sized, O: Debug> Debug for RelPtr<T, O> where
T::ArchivedMetadata: Debug,
Auto Trait Implementations
impl<T: ?Sized, O> RefUnwindSafe for RelPtr<T, O> where
O: RefUnwindSafe,
T: RefUnwindSafe,
<T as ArchivePointee>::ArchivedMetadata: RefUnwindSafe,
impl<T: ?Sized, O> Send for RelPtr<T, O> where
O: Send,
T: Send,
<T as ArchivePointee>::ArchivedMetadata: Send,
impl<T: ?Sized, O> Sync for RelPtr<T, O> where
O: Sync,
T: Sync,
<T as ArchivePointee>::ArchivedMetadata: Sync,
impl<T: ?Sized, O> UnwindSafe for RelPtr<T, O> where
O: UnwindSafe,
T: UnwindSafe,
<T as ArchivePointee>::ArchivedMetadata: UnwindSafe,
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more