pub struct CapRef { /* private fields */ }Expand description
Cache-local lifetime handle to a working Cap::Instance in
CacheDirectory.instances.
Clone bumps an inner Arc refcount; Drop decrements it. The
directory owns one CapRef per live entry alongside the data; when
external holders all drop their clones, CacheDirectory::sweep_instances
finds entries whose stored handle has strong_count == 1 and removes
them. No callback-on-drop, no deadlock discipline.
Two separate CacheDirectory instances produce independent id
namespaces — CapRefs must not cross caches.
The constructor is module-private: every handle in production traces
back to CacheDirectory::put_instance.
Implementations§
Trait Implementations§
impl Eq for CapRef
Auto Trait Implementations§
impl Freeze for CapRef
impl RefUnwindSafe for CapRef
impl Send for CapRef
impl Sync for CapRef
impl Unpin for CapRef
impl UnsafeUnpin for CapRef
impl UnwindSafe for CapRef
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.