[−][src]Struct opentelemetry_api::resource::Resource
Fields
labels: HashMap<Cow<'a, str>, Cow<'a, str>>
Methods
impl<'a> Resource<'a>
[src]
pub fn create<K, V>(labels: HashMap<K, V>) -> Self where
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
[src]
K: Into<Cow<'a, str>>,
V: Into<Cow<'a, str>>,
Creates a new Resource out of the collection of labels
Panics
If the following hold
- The length of a key or value is over 256 bytes
- If a key or value contains none ascii chars
pub fn merge(&mut self, other: Self)
[src]
Creates a new Resource that is a combination of labels of two Resources.
For example, from two Resources - one representing the host and one representing a container, resulting Resource will describe both.
Already set labels WILL NOT be overwritten unless they are empty string. Label key name-spacing SHOULD be used to prevent collisions across different resource detection steps.
pub fn labels(&self) -> HashMap<&str, &str>
[src]
pub fn get(&self, label: &str) -> Option<&str>
[src]
Helper method to get values for given labels
pub fn empty() -> Self
[src]
Trait Implementations
Auto Trait Implementations
impl<'a> Sync for Resource<'a>
impl<'a> Send for Resource<'a>
impl<'a> Unpin for Resource<'a>
impl<'a> RefUnwindSafe for Resource<'a>
impl<'a> UnwindSafe for Resource<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,