[−][src]Struct rustracing::span::Span
Span.
When this span is dropped, it will be converted to FinishedSpan
and
it will be sent to the associated SpanReceiver
.
Implementations
impl<T> Span<T>
[src]
pub fn inactive() -> Self
[src]
Makes an inactive span.
This span is never traced.
Examples
use rustracing::span::Span; let span = Span::<()>::inactive(); assert!(! span.is_sampled());
pub fn handle(&self) -> SpanHandle<T> where
T: Clone,
[src]
T: Clone,
Returns a handle of this span.
pub fn is_sampled(&self) -> bool
[src]
Returns true
if this span is sampled (i.e., being traced).
pub fn context(&self) -> Option<&SpanContext<T>>
[src]
Returns the context of this span.
pub fn set_operation_name<F, N>(&mut self, f: F) where
F: FnOnce() -> N,
N: Into<Cow<'static, str>>,
[src]
F: FnOnce() -> N,
N: Into<Cow<'static, str>>,
Sets the operation name of this span.
pub fn set_start_time<F>(&mut self, f: F) where
F: FnOnce() -> SystemTime,
[src]
F: FnOnce() -> SystemTime,
Sets the start time of this span.
pub fn set_finish_time<F>(&mut self, f: F) where
F: FnOnce() -> SystemTime,
[src]
F: FnOnce() -> SystemTime,
Sets the finish time of this span.
pub fn set_tag<F>(&mut self, f: F) where
F: FnOnce() -> Tag,
[src]
F: FnOnce() -> Tag,
Sets the tag to this span.
pub fn set_tags<F, I>(&mut self, f: F) where
F: FnOnce() -> I,
I: IntoIterator<Item = Tag>,
[src]
F: FnOnce() -> I,
I: IntoIterator<Item = Tag>,
Sets the tags to this span.
pub fn set_baggage_item<F>(&mut self, f: F) where
F: FnOnce() -> BaggageItem,
[src]
F: FnOnce() -> BaggageItem,
Sets the baggage item to this span.
pub fn get_baggage_item(&self, name: &str) -> Option<&BaggageItem>
[src]
Gets the baggage item that has the name name
.
pub fn log<F>(&mut self, f: F) where
F: FnOnce(&mut LogBuilder),
[src]
F: FnOnce(&mut LogBuilder),
Logs structured data.
pub fn error_log<F>(&mut self, f: F) where
F: FnOnce(&mut StdErrorLogFieldsBuilder<'_>),
[src]
F: FnOnce(&mut StdErrorLogFieldsBuilder<'_>),
Logs an error.
This is a simple wrapper of log
method
except that the StdTag::error()
tag will be set in this method.
pub fn child<N, F>(&self, operation_name: N, f: F) -> Span<T> where
N: Into<Cow<'static, str>>,
T: Clone,
F: FnOnce(StartSpanOptions<'_, AllSampler, T>) -> Span<T>,
[src]
N: Into<Cow<'static, str>>,
T: Clone,
F: FnOnce(StartSpanOptions<'_, AllSampler, T>) -> Span<T>,
Starts a ChildOf
span if this span is sampled.
pub fn follower<N, F>(&self, operation_name: N, f: F) -> Span<T> where
N: Into<Cow<'static, str>>,
T: Clone,
F: FnOnce(StartSpanOptions<'_, AllSampler, T>) -> Span<T>,
[src]
N: Into<Cow<'static, str>>,
T: Clone,
F: FnOnce(StartSpanOptions<'_, AllSampler, T>) -> Span<T>,
Starts a FollowsFrom
span if this span is sampled.
Trait Implementations
impl<T: Debug> Debug for Span<T>
[src]
impl<T> Drop for Span<T>
[src]
impl<T> MaybeAsRef<SpanContext<T>> for Span<T>
[src]
pub fn maybe_as_ref(&self) -> Option<&SpanContext<T>>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Span<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for Span<T> where
T: Send,
[src]
T: Send,
impl<T> Sync for Span<T> where
T: Send + Sync,
[src]
T: Send + Sync,
impl<T> Unpin for Span<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Span<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
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]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
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]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,