pub trait Strategy<T: ?Sized> {
// Required methods
fn inject(container: &mut T, context: DatadogContext);
fn extract(container: &T) -> DatadogContext;
}Expand description
Strategy for extracting/injecting DatadogContext from/to a container type.
See TraceContextExt for an example of the intended use.
Required Methods§
Sourcefn inject(container: &mut T, context: DatadogContext)
fn inject(container: &mut T, context: DatadogContext)
Injects a trace context into T.
If the provided context is empty, T is unchanged.
Sourcefn extract(container: &T) -> DatadogContext
fn extract(container: &T) -> DatadogContext
Extracts a trace context from T.
If T does not contain a valid trace context, the resulting context will be empty.
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.