pub struct AnnotationState { /* private fields */ }Expand description
Per-annotation persistent state
Used for annotations that need to maintain state across calls
Implementations§
Source§impl AnnotationState
impl AnnotationState
pub fn new() -> Self
Sourcepub fn get(&self, key: &str) -> Option<&KindedSlot>
pub fn get(&self, key: &str) -> Option<&KindedSlot>
Get a state value as KindedSlot reference
pub fn set(&mut self, key: String, value: KindedSlot)
pub fn contains(&self, key: &str) -> bool
pub fn remove(&mut self, key: &str) -> Option<KindedSlot>
pub fn clear(&mut self)
Trait Implementations§
Source§impl Clone for AnnotationState
impl Clone for AnnotationState
Source§fn clone(&self) -> AnnotationState
fn clone(&self) -> AnnotationState
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 AnnotationState
impl Debug for AnnotationState
Source§impl Default for AnnotationState
impl Default for AnnotationState
Source§fn default() -> AnnotationState
fn default() -> AnnotationState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AnnotationState
impl RefUnwindSafe for AnnotationState
impl Send for AnnotationState
impl Sync for AnnotationState
impl Unpin for AnnotationState
impl UnsafeUnpin for AnnotationState
impl UnwindSafe for AnnotationState
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