pub struct Labels(/* private fields */);Expand description
Intrinsic-fact map. See module docs and SRD-0005.
Implementations§
Source§impl Labels
impl Labels
Sourcepub fn insert(&mut self, key: LabelKey, value: LabelValue) -> Option<LabelValue>
pub fn insert(&mut self, key: LabelKey, value: LabelValue) -> Option<LabelValue>
Insert a label. Returns the previous value for key, if any.
Sourcepub fn get(&self, key: &LabelKey) -> Option<&LabelValue>
pub fn get(&self, key: &LabelKey) -> Option<&LabelValue>
Look up a label.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&LabelKey, &LabelValue)>
pub fn iter(&self) -> impl Iterator<Item = (&LabelKey, &LabelValue)>
Sorted-by-key iterator over (key, value) pairs.
Sourcepub fn contains_key(&self, key: &LabelKey) -> bool
pub fn contains_key(&self, key: &LabelKey) -> bool
Key-membership test.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Labels
impl<'de> Deserialize<'de> for Labels
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 FromIterator<(LabelKey, LabelValue)> for Labels
impl FromIterator<(LabelKey, LabelValue)> for Labels
Source§fn from_iter<I: IntoIterator<Item = (LabelKey, LabelValue)>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = (LabelKey, LabelValue)>>(iter: I) -> Self
Creates a value from an iterator. Read more
impl Eq for Labels
impl StructuralPartialEq for Labels
Auto Trait Implementations§
impl Freeze for Labels
impl RefUnwindSafe for Labels
impl Send for Labels
impl Sync for Labels
impl Unpin for Labels
impl UnsafeUnpin for Labels
impl UnwindSafe for Labels
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.