pub trait AttributesLike {
type Value: AttributeLike;
// Required methods
fn as_object(&self) -> &Object<Self::Value>;
fn as_object_mut(&mut self) -> &mut Object<Self::Value>;
// Provided methods
fn contains_key(&self, key: &str) -> bool { ... }
fn insert(&mut self, key: String, value: Annotated<Self::Value>) { ... }
fn remove(&mut self, key: &str) -> Option<Annotated<Self::Value>> { ... }
}Expand description
An attribute collection which is keyed by an attribute key defined in relay_conventions.
This exists as a common abstraction over SpanData and Attributes. Its purpose is to
allow modern attribute based normalizations also to apply to transaction based spans,
eliminating the need to duplicate code.
This largely mirrors the API of Attributes and provides it also for SpanData.
Required Associated Types§
Required Methods§
Sourcefn as_object(&self) -> &Object<Self::Value>
fn as_object(&self) -> &Object<Self::Value>
Access this container through the underlying Object.
Sourcefn as_object_mut(&mut self) -> &mut Object<Self::Value>
fn as_object_mut(&mut self) -> &mut Object<Self::Value>
Access this container through the underlying Object mutably.
Provided Methods§
Sourcefn contains_key(&self, key: &str) -> bool
fn contains_key(&self, key: &str) -> bool
Checks whether this collection contains an attribute with the given key.