pub struct SpanEvent { /* private fields */ }Expand description
An event associated with a span.
Implementations§
Source§impl SpanEvent
impl SpanEvent
Sourcepub fn new(time_unix_nano: u64, name: impl Into<MetaString>) -> Self
pub fn new(time_unix_nano: u64, name: impl Into<MetaString>) -> Self
Creates a new span event with the given timestamp and name.
Sourcepub fn with_time_unix_nano(self, time_unix_nano: u64) -> Self
pub fn with_time_unix_nano(self, time_unix_nano: u64) -> Self
Sets the event timestamp.
Sourcepub fn with_attributes(
self,
attributes: impl Into<Option<FastHashMap<MetaString, AttributeValue>>>,
) -> Self
pub fn with_attributes( self, attributes: impl Into<Option<FastHashMap<MetaString, AttributeValue>>>, ) -> Self
Replaces the attributes map.
Sourcepub fn time_unix_nano(&self) -> u64
pub fn time_unix_nano(&self) -> u64
Returns the event timestamp.
Sourcepub fn attributes(&self) -> &FastHashMap<MetaString, AttributeValue>
pub fn attributes(&self) -> &FastHashMap<MetaString, AttributeValue>
Returns the attributes map.
Sourcepub fn attributes_mut(&mut self) -> &mut FastHashMap<MetaString, AttributeValue>
pub fn attributes_mut(&mut self) -> &mut FastHashMap<MetaString, AttributeValue>
Returns a mutable reference to the attributes map.
Trait Implementations§
Source§impl Attributes for SpanEvent
impl Attributes for SpanEvent
type Text = MetaString
type Bytes = Vec<u8>
type Values = SalukiValues
Source§fn attribute_str(&self, key: &str) -> Option<&str>
fn attribute_str(&self, key: &str) -> Option<&str>
Get the string value of the attribute for a given key,
None if it is missing or not a
string.Source§fn attribute_f64(&self, key: &str) -> Option<f64>
fn attribute_f64(&self, key: &str) -> Option<f64>
Get the numeric value of the attribute for a given key,
None if it is missing or not a
number. Integers are converted to f64.Source§impl AttributesIter for SpanEvent
impl AttributesIter for SpanEvent
Source§fn attributes(
&self,
) -> impl Iterator<Item = (&str, AttributeRef<'_, SalukiValues>)>
fn attributes( &self, ) -> impl Iterator<Item = (&str, AttributeRef<'_, SalukiValues>)>
Iterate over all
(key, value) attribute pairs, each key at most onceSource§impl AttributesMut for SpanEvent
impl AttributesMut for SpanEvent
Source§fn retain_attributes(
&mut self,
f: impl FnMut(&str, &mut AttributeValue) -> bool,
)
fn retain_attributes( &mut self, f: impl FnMut(&str, &mut AttributeValue) -> bool, )
Keep only the attributes for which
f returns true; f may mutate the values it keeps.
Like [AttributesIter::attributes], f sees each key once.Source§fn attribute_mut(&mut self, key: &str) -> Option<&mut AttributeValue>
fn attribute_mut(&mut self, key: &str) -> Option<&mut AttributeValue>
Get a mutable reference to the value for a given key,
None if it is missingSource§fn set_attribute(&mut self, key: MetaString, value: AttributeValue)
fn set_attribute(&mut self, key: MetaString, value: AttributeValue)
Set the attribute for
key, replacing any existing value for that keySource§fn remove_attribute(&mut self, key: &str) -> Option<AttributeValue>
fn remove_attribute(&mut self, key: &str) -> Option<AttributeValue>
Remove the attribute for
key, returning its value if it was presentimpl StructuralPartialEq for SpanEvent
Auto Trait Implementations§
impl Freeze for SpanEvent
impl RefUnwindSafe for SpanEvent
impl Send for SpanEvent
impl Sync for SpanEvent
impl Unpin for SpanEvent
impl UnsafeUnpin for SpanEvent
impl UnwindSafe for SpanEvent
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,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Instruments this type by attaching the current resource group, returning a
Tracked wrapper. Read more