pub trait SpanExt {
// Required method
fn operation(&self) -> Operation;
// Provided method
fn start_operation(
&self,
id: impl AsRef<str>,
producer: Option<impl AsRef<str>>,
) -> Operation { ... }
}Expand description
This trait extends tracing::Span with additional functionality provided by this crate.
You should not implement this trait yourself, but I also cannot stop you.
Required Methods§
Provided Methods§
Sourcefn start_operation(
&self,
id: impl AsRef<str>,
producer: Option<impl AsRef<str>>,
) -> Operation
fn start_operation( &self, id: impl AsRef<str>, producer: Option<impl AsRef<str>>, ) -> Operation
A simple wrapper over Operation::init to make creating them a bit nicer.
let op = span.start_operation("id", Some("provider"));The above is equivalent to:
let op = span.operation();
op.init(OperationInfo::new("id", Some("provider")));Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.