pub trait ScopeFutureExt: Future + Sized {
// Provided method
fn with_flare_scope(self, scope: Scope) -> WithScope<Self> ⓘ { ... }
}Expand description
Gives a future its own scope, so the user, context and breadcrumbs of one
request stay with that request, across every .await.
§Examples
use flareapp_core::{Scope, ScopeFutureExt, User};
let mut scope = Scope::default();
scope.set_user(User::new("42"));
let request = async { /* handle the request */ }.with_flare_scope(scope);Provided Methods§
Sourcefn with_flare_scope(self, scope: Scope) -> WithScope<Self> ⓘ
fn with_flare_scope(self, scope: Scope) -> WithScope<Self> ⓘ
Runs this future with scope on top of the app-wide scope.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".