Enum rkyv::rc::ArchivedRcWeak
source · [−]#[repr(u8)]
pub enum ArchivedRcWeak<T: ArchivePointee + ?Sized, F> {
None,
Some(ArchivedRc<T, F>),
}
Expand description
An archived rc::Weak
.
This is essentially just an optional ArchivedRc
.
Variants
None
A null weak pointer
Some(ArchivedRc<T, F>)
A weak pointer to some shared pointer
Implementations
sourceimpl<T: ArchivePointee + ?Sized, F> ArchivedRcWeak<T, F>
impl<T: ArchivePointee + ?Sized, F> ArchivedRcWeak<T, F>
sourcepub fn upgrade(&self) -> Option<&ArchivedRc<T, F>>
pub fn upgrade(&self) -> Option<&ArchivedRc<T, F>>
Attempts to upgrade the weak pointer to an ArchivedArc
.
Returns None
if a null weak pointer was serialized.
sourcepub fn upgrade_pin_mut(
self: Pin<&mut Self>
) -> Option<Pin<&mut ArchivedRc<T, F>>>
pub fn upgrade_pin_mut(
self: Pin<&mut Self>
) -> Option<Pin<&mut ArchivedRc<T, F>>>
Attempts to upgrade a pinned mutable weak pointer.
sourcepub unsafe fn resolve_from_ref<U: ArchiveUnsized<Archived = T> + ?Sized>(
value: Option<&U>,
pos: usize,
resolver: RcWeakResolver<MetadataResolver<U>>,
out: *mut Self
)
pub unsafe fn resolve_from_ref<U: ArchiveUnsized<Archived = T> + ?Sized>(
value: Option<&U>,
pos: usize,
resolver: RcWeakResolver<MetadataResolver<U>>,
out: *mut Self
)
Resolves an archived Weak
from a given optional reference.
Safety
pos
must be the position ofout
within the archiveresolver
must be the result of serializingvalue
sourcepub fn serialize_from_ref<U, S>(
value: Option<&U>,
serializer: &mut S
) -> Result<RcWeakResolver<MetadataResolver<U>>, S::Error> where
U: SerializeUnsized<S, Archived = T> + ?Sized,
S: Serializer + SharedSerializeRegistry + ?Sized,
pub fn serialize_from_ref<U, S>(
value: Option<&U>,
serializer: &mut S
) -> Result<RcWeakResolver<MetadataResolver<U>>, S::Error> where
U: SerializeUnsized<S, Archived = T> + ?Sized,
S: Serializer + SharedSerializeRegistry + ?Sized,
Serializes an archived Weak
from a given optional reference.
Trait Implementations
sourceimpl<T: ArchivePointee + Debug + ?Sized, F> Debug for ArchivedRcWeak<T, F>
impl<T: ArchivePointee + Debug + ?Sized, F> Debug for ArchivedRcWeak<T, F>
sourceimpl<T, D> Deserialize<Weak<T>, D> for ArchivedRcWeak<T::Archived, RcFlavor> where
T: Archive + 'static,
T::Archived: DeserializeUnsized<T, D>,
D: SharedDeserializeRegistry + ?Sized,
impl<T, D> Deserialize<Weak<T>, D> for ArchivedRcWeak<T::Archived, RcFlavor> where
T: Archive + 'static,
T::Archived: DeserializeUnsized<T, D>,
D: SharedDeserializeRegistry + ?Sized,
sourceimpl<T, D> Deserialize<Weak<T>, D> for ArchivedRcWeak<T::Archived, ArcFlavor> where
T: Archive + 'static,
T::Archived: DeserializeUnsized<T, D>,
D: SharedDeserializeRegistry + ?Sized,
impl<T, D> Deserialize<Weak<T>, D> for ArchivedRcWeak<T::Archived, ArcFlavor> where
T: Archive + 'static,
T::Archived: DeserializeUnsized<T, D>,
D: SharedDeserializeRegistry + ?Sized,
Auto Trait Implementations
impl<T: ?Sized, F> RefUnwindSafe for ArchivedRcWeak<T, F> where
F: RefUnwindSafe,
T: RefUnwindSafe,
<T as ArchivePointee>::ArchivedMetadata: RefUnwindSafe,
impl<T: ?Sized, F> Send for ArchivedRcWeak<T, F> where
F: Send,
T: Send,
<T as ArchivePointee>::ArchivedMetadata: Send,
impl<T: ?Sized, F> Sync for ArchivedRcWeak<T, F> where
F: Sync,
T: Sync,
<T as ArchivePointee>::ArchivedMetadata: Sync,
impl<T, F> !Unpin for ArchivedRcWeak<T, F>
impl<T: ?Sized, F> UnwindSafe for ArchivedRcWeak<T, F> where
F: UnwindSafe,
T: UnwindSafe,
<T as ArchivePointee>::ArchivedMetadata: UnwindSafe,
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
sourcefn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
fn pointer_metadata(_: &Self::ArchivedMetadata) -> <Self as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more