Struct Key
#[non_exhaustive]pub struct Key(/* private fields */);
Available on crate feature
opentelemetry
only.Expand description
The key part of attribute KeyValue pairs.
See the attribute naming spec for guidelines.
Implementations§
§impl Key
impl Key
pub fn new(value: impl Into<Key>) -> Key
pub fn new(value: impl Into<Key>) -> Key
Create a new Key
.
§Examples
use opentelemetry::Key;
use std::sync::Arc;
let key1 = Key::new("my_static_str");
let key2 = Key::new(String::from("my_owned_string"));
let key3 = Key::new(Arc::from("my_ref_counted_str"));
pub const fn from_static_str(value: &'static str) -> Key
pub const fn from_static_str(value: &'static str) -> Key
Create a new const Key
.
Trait Implementations§
§impl Ord for Key
impl Ord for Key
§impl PartialOrd for Key
impl PartialOrd for Key
impl Eq for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnwindSafe for Key
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.