Skip to main content

CanonicalProblemMigrationExt

Trait CanonicalProblemMigrationExt 

Source
pub trait CanonicalProblemMigrationExt: Sized {
    // Required method
    fn with_temporary_request_context(self, instance: impl Into<String>) -> Self;
}
Expand description

Extension trait that fills trace_id and instance on a canonical Problem using the temporary span-id fallback documented in docs/arch/errors/DESIGN.md §3.7.

Per-module From<DomainError> for Problem impls call this at the end of the conversion so every wire response carries the same shape until the canonical error middleware takes over.

Required Methods§

Source

fn with_temporary_request_context(self, instance: impl Into<String>) -> Self

Set instance to the supplied path and trace_id to a span-id fallback derived from tracing::Span::current().

Pass "/" when no request URI is plumbed through to the call site (the common case for From<DomainError> for Problem).

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§