pub struct CacheRef {
pub key: AccessiblePrimitive,
/* private fields */
}Expand description
A composition of an accessible ID and (possibly) a reference
to its CacheItem, if the item has not been dropped from the cache yet.
TODO if desirable, we could make one direction strong references (e.g. have
the parent be an Arc, xor have the children be Arcs). Might even be possible to have both.
BUT - is it even desirable to keep an item pinned in an Arc from its
releatives after it has been removed from the cache?
Fields§
§key: AccessiblePrimitiveImplementations§
Source§impl CacheRef
impl CacheRef
pub fn new(key: AccessiblePrimitive) -> Self
pub fn clone_inner(&self) -> Option<CacheItem>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CacheRef
impl<'de> Deserialize<'de> for CacheRef
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AccessiblePrimitive> for CacheRef
impl From<AccessiblePrimitive> for CacheRef
Source§fn from(value: AccessiblePrimitive) -> Self
fn from(value: AccessiblePrimitive) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for CacheRef
impl RefUnwindSafe for CacheRef
impl Send for CacheRef
impl Sync for CacheRef
impl Unpin for CacheRef
impl UnwindSafe for CacheRef
Blanket Implementations§
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