Struct opentelemetry::testing::trace::TestSpan [−][src]
pub struct TestSpan(pub SpanContext);
Trait Implementations
impl Span for TestSpan
[src]
impl Span for TestSpan
[src]fn add_event_with_timestamp(
&mut self,
_name: String,
_timestamp: SystemTime,
_attributes: Vec<KeyValue>
)
[src]
fn add_event_with_timestamp(
&mut self,
_name: String,
_timestamp: SystemTime,
_attributes: Vec<KeyValue>
)
[src]trace
only.An API to record events at a specific time in the context of a given Span
. Read more
fn span_context(&self) -> &SpanContext
[src]
fn span_context(&self) -> &SpanContext
[src]trace
only.Returns the SpanContext
for the given Span
. The returned value may be used even after
the Span is finished. The returned value MUST be the same for the entire
Span` lifetime. Read more
fn is_recording(&self) -> bool
[src]
fn is_recording(&self) -> bool
[src]trace
only.Returns true if this Span
is recording information like events with the add_event
operation, attributes using set_attributes
, status with set_status
, etc. Read more
fn set_attribute(&mut self, _attribute: KeyValue)
[src]
fn set_attribute(&mut self, _attribute: KeyValue)
[src]trace
only.An API to set a single Attribute
where the attribute properties are passed
as arguments. To avoid extra allocations some implementations may offer a separate API for
each of the possible value types. Read more
fn set_status(&mut self, _code: StatusCode, _message: String)
[src]
fn set_status(&mut self, _code: StatusCode, _message: String)
[src]trace
only.Sets the status of the Span
. If used, this will override the default Span
status, which is Unset
. message
MUST be ignored when the status is OK
or Unset
Read more
fn update_name(&mut self, _new_name: String)
[src]
fn update_name(&mut self, _new_name: String)
[src]trace
only.Updates the Span
’s name. After this update, any sampling behavior based on the
name will depend on the implementation. Read more
fn end_with_timestamp(&mut self, _timestamp: SystemTime)
[src]
fn end_with_timestamp(&mut self, _timestamp: SystemTime)
[src]trace
only.Finishes the Span
with given timestamp Read more
fn add_event(&mut self, name: String, attributes: Vec<KeyValue>)
[src]
fn add_event(&mut self, name: String, attributes: Vec<KeyValue>)
[src]trace
only.An API to record events in the context of a given Span
. Read more
fn record_exception(&mut self, err: &dyn Error)
[src]
fn record_exception(&mut self, err: &dyn Error)
[src]trace
only.Convenience method to record an exception/error as an Event
Read more
fn record_exception_with_stacktrace(
&mut self,
err: &dyn Error,
stacktrace: String
)
[src]
fn record_exception_with_stacktrace(
&mut self,
err: &dyn Error,
stacktrace: String
)
[src]trace
only.Convenience method to record a exception/error as an Event
with custom stacktrace Read more
Auto Trait Implementations
impl RefUnwindSafe for TestSpan
impl Send for TestSpan
impl Sync for TestSpan
impl Unpin for TestSpan
impl UnwindSafe for TestSpan
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,