pub struct NamedRegistry { /* private fields */ }Expand description
A named registry for storing values (functions, patterns, etc.)
Used by custom annotations (e.g. @strategy, @feature)
Implementations§
Source§impl NamedRegistry
impl NamedRegistry
pub fn new() -> Self
Sourcepub fn get(&self, key: &str) -> Option<&KindedSlot>
pub fn get(&self, key: &str) -> Option<&KindedSlot>
Get a registry 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 keys(&self) -> impl Iterator<Item = &String>
Sourcepub fn values(&self) -> impl Iterator<Item = &KindedSlot>
pub fn values(&self) -> impl Iterator<Item = &KindedSlot>
Iterate over values as KindedSlot references
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for NamedRegistry
impl Clone for NamedRegistry
Source§fn clone(&self) -> NamedRegistry
fn clone(&self) -> NamedRegistry
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 NamedRegistry
impl Debug for NamedRegistry
Source§impl Default for NamedRegistry
impl Default for NamedRegistry
Source§fn default() -> NamedRegistry
fn default() -> NamedRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NamedRegistry
impl RefUnwindSafe for NamedRegistry
impl Send for NamedRegistry
impl Sync for NamedRegistry
impl Unpin for NamedRegistry
impl UnsafeUnpin for NamedRegistry
impl UnwindSafe for NamedRegistry
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