[][src]Function tokio_trace::dispatcher::with_default

pub fn with_default<T, impl FnOnce() -> T>(
    dispatcher: &Dispatch,
    f: impl FnOnce() -> T
) -> T where
    impl FnOnce() -> T: FnOnce() -> T, 

Sets this dispatch as the default for the duration of a closure.

The default dispatcher is used when creating a new span or Event, if no span is currently executing. If a span is currently executing, new spans or events are dispatched to the subscriber that tagged that span, instead.