pub struct AnnotationCache { /* private fields */ }Expand description
Key-value cache for annotation memoization
Used by annotations like @cached, @indicator, @memo
Implementations§
Source§impl AnnotationCache
impl AnnotationCache
pub fn new() -> Self
Sourcepub fn get(&self, key: &str) -> Option<&KindedSlot>
pub fn get(&self, key: &str) -> Option<&KindedSlot>
Get a cached value by key as KindedSlot reference
Sourcepub fn get_entry(&self, key: &str) -> Option<&CacheEntry>
pub fn get_entry(&self, key: &str) -> Option<&CacheEntry>
Get a cached entry (includes metadata)
Sourcepub fn set(&mut self, key: String, value: KindedSlot)
pub fn set(&mut self, key: String, value: KindedSlot)
Set a cached value
Sourcepub fn remove(&mut self, key: &str) -> Option<KindedSlot>
pub fn remove(&mut self, key: &str) -> Option<KindedSlot>
Remove a cached value
Trait Implementations§
Source§impl Clone for AnnotationCache
impl Clone for AnnotationCache
Source§fn clone(&self) -> AnnotationCache
fn clone(&self) -> AnnotationCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnnotationCache
impl Debug for AnnotationCache
Source§impl Default for AnnotationCache
impl Default for AnnotationCache
Source§fn default() -> AnnotationCache
fn default() -> AnnotationCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AnnotationCache
impl RefUnwindSafe for AnnotationCache
impl Send for AnnotationCache
impl Sync for AnnotationCache
impl Unpin for AnnotationCache
impl UnsafeUnpin for AnnotationCache
impl UnwindSafe for AnnotationCache
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