pub trait TraceContextExt {
// Required methods
fn current() -> TraceContext;
fn set_current(context: TraceContext);
fn with<F, R>(context: TraceContext, f: F) -> R
where F: FnOnce() -> R;
}Expand description
TraceContext 扩展 trait
Required Methods§
Sourcefn current() -> TraceContext
fn current() -> TraceContext
获取当前上下文
Sourcefn set_current(context: TraceContext)
fn set_current(context: TraceContext)
设置当前上下文
Sourcefn with<F, R>(context: TraceContext, f: F) -> Rwhere
F: FnOnce() -> R,
fn with<F, R>(context: TraceContext, f: F) -> Rwhere
F: FnOnce() -> R,
在指定上下文中执行闭包
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.