Skip to main content

Storage

Trait Storage 

Source
pub trait Storage: Send + Sync {
    // Required methods
    fn get(&self) -> Option<Span>;
    fn set(&self, span: Option<Span>);
}
Expand description

Keeps the current span of an execution context, so Span::add and Span::current work without passing spans around.

Implement it to keep spans elsewhere (a thread-local, a request extension); register it with Span::set_storage.

PHP: Utopia\Span\Storage\Storage.

Required Methods§

Source

fn get(&self) -> Option<Span>

The current span of this context, if any.

PHP: get().

Source

fn set(&self, span: Option<Span>)

Sets (or clears, with None) the current span of this context.

PHP: set($span).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§