pub struct NoopSpan { /* private fields */ }
Available on crate feature
trace
only.Expand description
A no-op instance of a Span
.
Implementations
Trait Implementations
sourceimpl Span for NoopSpan
impl Span for NoopSpan
sourcefn add_event<T>(&mut self, _name: T, _attributes: Vec<KeyValue>)where
T: Into<Cow<'static, str>>,
fn add_event<T>(&mut self, _name: T, _attributes: Vec<KeyValue>)where
T: Into<Cow<'static, str>>,
Ignores all events
sourcefn add_event_with_timestamp<T>(
&mut self,
_name: T,
_timestamp: SystemTime,
_attributes: Vec<KeyValue>
)where
T: Into<Cow<'static, str>>,
fn add_event_with_timestamp<T>(
&mut self,
_name: T,
_timestamp: SystemTime,
_attributes: Vec<KeyValue>
)where
T: Into<Cow<'static, str>>,
Ignores all events with timestamps
sourcefn span_context(&self) -> &SpanContext
fn span_context(&self) -> &SpanContext
Returns an invalid SpanContext
.
sourcefn is_recording(&self) -> bool
fn is_recording(&self) -> bool
Returns false, signifying that this span is never recording.
sourcefn set_attribute(&mut self, _attribute: KeyValue)
fn set_attribute(&mut self, _attribute: KeyValue)
Ignores all attributes
sourcefn set_status(&mut self, _status: Status)
fn set_status(&mut self, _status: Status)
Ignores status
sourcefn update_name<T>(&mut self, _new_name: T)where
T: Into<Cow<'static, str>>,
fn update_name<T>(&mut self, _new_name: T)where
T: Into<Cow<'static, str>>,
Ignores name updates
sourcefn end_with_timestamp(&mut self, _timestamp: SystemTime)
fn end_with_timestamp(&mut self, _timestamp: SystemTime)
Ignores Span
endings
sourcefn record_error(&mut self, err: &dyn Error)
fn record_error(&mut self, err: &dyn Error)
Record an error as an event for this span. Read more
sourcefn set_attributes(&mut self, attributes: impl IntoIterator<Item = KeyValue>)
fn set_attributes(&mut self, attributes: impl IntoIterator<Item = KeyValue>)
Set multiple attributes of this span. Read more
Auto Trait Implementations
impl RefUnwindSafe for NoopSpan
impl Send for NoopSpan
impl Sync for NoopSpan
impl Unpin for NoopSpan
impl UnwindSafe for NoopSpan
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more