Struct rkyv::rc::ArchivedRc
source · pub struct ArchivedRc<T: ArchivePointee + ?Sized, F>(/* private fields */);
Expand description
An archived Rc
.
This is a thin wrapper around a RelPtr
to the archived type paired with a “flavor” type.
Because there may be many varieties of shared pointers and they may not be used together, the
flavor helps check that memory is not being shared incorrectly during validation.
Implementations§
source§impl<T: ArchivePointee + ?Sized, F> ArchivedRc<T, F>
impl<T: ArchivePointee + ?Sized, F> ArchivedRc<T, F>
sourcepub unsafe fn get_pin_mut_unchecked(self: Pin<&mut Self>) -> Pin<&mut T>
pub unsafe fn get_pin_mut_unchecked(self: Pin<&mut Self>) -> Pin<&mut T>
Gets the pinned mutable value of this ArchivedRc
.
§Safety
Any other ArchivedRc
pointers to the same value must not be dereferenced for the duration
of the returned borrow.
sourcepub unsafe fn resolve_from_ref<U: ArchiveUnsized<Archived = T> + ?Sized>(
value: &U,
pos: usize,
resolver: RcResolver<MetadataResolver<U>>,
out: *mut Self,
)
pub unsafe fn resolve_from_ref<U: ArchiveUnsized<Archived = T> + ?Sized>( value: &U, pos: usize, resolver: RcResolver<MetadataResolver<U>>, out: *mut Self, )
Resolves an archived Rc
from a given reference.
§Safety
pos
must be the position ofout
within the archiveresolver
must be the result of serializingvalue
sourcepub fn serialize_from_ref<U: SerializeUnsized<S> + ?Sized, S: Serializer + SharedSerializeRegistry + ?Sized>(
value: &U,
serializer: &mut S,
) -> Result<RcResolver<MetadataResolver<U>>, S::Error>
pub fn serialize_from_ref<U: SerializeUnsized<S> + ?Sized, S: Serializer + SharedSerializeRegistry + ?Sized>( value: &U, serializer: &mut S, ) -> Result<RcResolver<MetadataResolver<U>>, S::Error>
Serializes an archived Rc
from a given reference.
Trait Implementations§
source§impl<T: ArchivePointee + ?Sized, F> AsRef<T> for ArchivedRc<T, F>
impl<T: ArchivePointee + ?Sized, F> AsRef<T> for ArchivedRc<T, F>
source§impl<T: ArchivePointee + ?Sized, F> Borrow<T> for ArchivedRc<T, F>
impl<T: ArchivePointee + ?Sized, F> Borrow<T> for ArchivedRc<T, F>
source§impl<T: ArchivePointee + Debug + ?Sized, F> Debug for ArchivedRc<T, F>
impl<T: ArchivePointee + Debug + ?Sized, F> Debug for ArchivedRc<T, F>
source§impl<T: ArchivePointee + ?Sized, F> Deref for ArchivedRc<T, F>
impl<T: ArchivePointee + ?Sized, F> Deref for ArchivedRc<T, F>
source§impl<T: ArchiveUnsized + ?Sized + 'static, D: SharedDeserializeRegistry + ?Sized> Deserialize<Arc<T>, D> for ArchivedRc<T::Archived, ArcFlavor>where
T::Archived: DeserializeUnsized<T, D>,
impl<T: ArchiveUnsized + ?Sized + 'static, D: SharedDeserializeRegistry + ?Sized> Deserialize<Arc<T>, D> for ArchivedRc<T::Archived, ArcFlavor>where
T::Archived: DeserializeUnsized<T, D>,
source§impl<T, D> Deserialize<Rc<T>, D> for ArchivedRc<T::Archived, RcFlavor>where
T: ArchiveUnsized + ?Sized + 'static,
T::Archived: DeserializeUnsized<T, D>,
D: SharedDeserializeRegistry + ?Sized,
impl<T, D> Deserialize<Rc<T>, D> for ArchivedRc<T::Archived, RcFlavor>where
T: ArchiveUnsized + ?Sized + 'static,
T::Archived: DeserializeUnsized<T, D>,
D: SharedDeserializeRegistry + ?Sized,
source§impl<T: ArchivePointee + Display + ?Sized, F> Display for ArchivedRc<T, F>
impl<T: ArchivePointee + Display + ?Sized, F> Display for ArchivedRc<T, F>
source§impl<T: ArchivePointee + Hash + ?Sized, F> Hash for ArchivedRc<T, F>
impl<T: ArchivePointee + Hash + ?Sized, F> Hash for ArchivedRc<T, F>
source§impl<T: ArchivePointee + Ord + ?Sized, F> Ord for ArchivedRc<T, F>
impl<T: ArchivePointee + Ord + ?Sized, F> Ord for ArchivedRc<T, F>
source§impl<T, U> PartialEq<Arc<U>> for ArchivedRc<T, ArcFlavor>
impl<T, U> PartialEq<Arc<U>> for ArchivedRc<T, ArcFlavor>
source§impl<T, TF, U, UF> PartialEq<ArchivedRc<U, UF>> for ArchivedRc<T, TF>
impl<T, TF, U, UF> PartialEq<ArchivedRc<U, UF>> for ArchivedRc<T, TF>
source§fn eq(&self, other: &ArchivedRc<U, UF>) -> bool
fn eq(&self, other: &ArchivedRc<U, UF>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<T: ArchivePointee + PartialEq<U> + ?Sized, U: ?Sized> PartialEq<Rc<U>> for ArchivedRc<T, RcFlavor>
impl<T: ArchivePointee + PartialEq<U> + ?Sized, U: ?Sized> PartialEq<Rc<U>> for ArchivedRc<T, RcFlavor>
source§impl<T, TF, U, UF> PartialOrd<ArchivedRc<U, UF>> for ArchivedRc<T, TF>
impl<T, TF, U, UF> PartialOrd<ArchivedRc<U, UF>> for ArchivedRc<T, TF>
source§fn partial_cmp(&self, other: &ArchivedRc<U, UF>) -> Option<Ordering>
fn partial_cmp(&self, other: &ArchivedRc<U, UF>) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl<T, F> Pointer for ArchivedRc<T, F>
impl<T, F> Pointer for ArchivedRc<T, F>
impl<T: ArchivePointee + Eq + ?Sized, F> Eq for ArchivedRc<T, F>
Auto Trait Implementations§
impl<T, F> Freeze for ArchivedRc<T, F>
impl<T, F> RefUnwindSafe for ArchivedRc<T, F>where
<T as ArchivePointee>::ArchivedMetadata: RefUnwindSafe,
F: RefUnwindSafe,
T: RefUnwindSafe + ?Sized,
impl<T, F> Send for ArchivedRc<T, F>
impl<T, F> Sync for ArchivedRc<T, F>
impl<T, F> !Unpin for ArchivedRc<T, F>
impl<T, F> UnwindSafe for ArchivedRc<T, F>
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more