Struct opentelemetry::testing::trace::TestSpan[][src]

pub struct TestSpan(pub SpanContext);

Trait Implementations

impl Debug for TestSpan[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Span for TestSpan[src]

fn add_event_with_timestamp(
    &mut self,
    _name: String,
    _timestamp: SystemTime,
    _attributes: Vec<KeyValue>
)
[src]

This is supported on crate feature 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]

This is supported on crate feature 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]

This is supported on crate feature 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]

This is supported on crate feature 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]

This is supported on crate feature 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]

This is supported on crate feature 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]

This is supported on crate feature trace only.

Finishes the Span with given timestamp Read more

fn add_event(&mut self, name: String, attributes: Vec<KeyValue>)[src]

This is supported on crate feature 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]

This is supported on crate feature 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]

This is supported on crate feature trace only.

Convenience method to record a exception/error as an Event with custom stacktrace Read more

fn end(&mut self)[src]

This is supported on crate feature trace only.

Finishes the Span. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V