TraceContextExt

Trait TraceContextExt 

Source
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§

Source

fn current() -> TraceContext

获取当前上下文

Source

fn set_current(context: TraceContext)

设置当前上下文

Source

fn with<F, R>(context: TraceContext, f: F) -> R
where 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.

Implementors§