pub struct Resource { /* private fields */ }
Expand description
An immutable representation of the entity producing telemetry as attributes.
Utilizes Arc
for efficient sharing and cloning.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn builder() -> ResourceBuilder
pub fn builder() -> ResourceBuilder
Creates a ResourceBuilder that allows you to configure multiple aspects of the Resource.
This ResourceBuilder will include the following ResourceDetectors:
- SdkProvidedResourceDetector
- TelemetryResourceDetector
- EnvResourceDetector If you’d like to start from an empty resource, use Resource::builder_empty.
Sourcepub fn builder_empty() -> ResourceBuilder
pub fn builder_empty() -> ResourceBuilder
Creates a ResourceBuilder that allows you to configure multiple aspects of the Resource.
This ResourceBuilder will not include any attributes or ResourceDetectors by default.
Sourcepub fn schema_url(&self) -> Option<&str>
pub fn schema_url(&self) -> Option<&str>
Return the schema url of the resource. If the resource does not have a schema url, return None
.
Trait Implementations§
Source§impl<'a> IntoIterator for &'a Resource
impl<'a> IntoIterator for &'a Resource
impl StructuralPartialEq for Resource
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
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