pub struct Labelset { /* private fields */ }
Expand description
A set of key-value labels that can be installed as the current label set.
Implementations§
Source§impl Labelset
impl Labelset
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new label set with the specified capacity.
Sourcepub fn clone_from_current() -> Self
pub fn clone_from_current() -> Self
Create a new label set by cloning the current one, if it exists, or creating a new one otherwise.
Sourcepub fn try_clone_from_current() -> Option<Self>
pub fn try_clone_from_current() -> Option<Self>
Create a new label set by cloning the current one, if it exists,
Sourcepub fn enter<F, Ret>(&mut self, f: F) -> Retwhere
F: FnOnce() -> Ret,
pub fn enter<F, Ret>(&mut self, f: F) -> Retwhere
F: FnOnce() -> Ret,
Run a function with this set of labels applied.
Sourcepub fn set<K, V>(&mut self, key: K, value: V)
pub fn set<K, V>(&mut self, key: K, value: V)
Adds the specified key-value pair to the label set.
Trait Implementations§
Source§impl<K, V> Extend<(K, V)> for Labelset
impl<K, V> Extend<(K, V)> for Labelset
Source§fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, V)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
impl Send for Labelset
Auto Trait Implementations§
impl Freeze for Labelset
impl RefUnwindSafe for Labelset
impl !Sync for Labelset
impl Unpin for Labelset
impl UnwindSafe for Labelset
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