#[non_exhaustive]pub struct PropagatorContext {
pub request_headers: HashMap<String, Vec<String>>,
pub metadata: HashMap<String, Value>,
}Expand description
Extension data extracted by ServerPropagator for downstream propagation.
Aligned with Go’s internal propagatorContext struct.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.request_headers: HashMap<String, Vec<String>>HTTP headers to propagate (key → values).
metadata: HashMap<String, Value>Payload metadata to propagate (key → value).
Implementations§
Source§impl PropagatorContext
impl PropagatorContext
Sourcepub fn install(self) -> bool
pub fn install(self) -> bool
Stores this context in the task-local cell.
Requires that the current task is running within init_propagation.
Returns true if stored successfully.
Sourcepub async fn scope<F: Future>(self, f: F) -> F::Output
pub async fn scope<F: Future>(self, f: F) -> F::Output
Executes a future with this context directly available via task-local.
This is a convenience wrapper for simple cases where you already have
the context and want to make it available to ClientPropagator.
Trait Implementations§
Source§impl Clone for PropagatorContext
impl Clone for PropagatorContext
Source§fn clone(&self) -> PropagatorContext
fn clone(&self) -> PropagatorContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PropagatorContext
impl Debug for PropagatorContext
Source§impl Default for PropagatorContext
impl Default for PropagatorContext
Source§fn default() -> PropagatorContext
fn default() -> PropagatorContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PropagatorContext
impl RefUnwindSafe for PropagatorContext
impl Send for PropagatorContext
impl Sync for PropagatorContext
impl Unpin for PropagatorContext
impl UnsafeUnpin for PropagatorContext
impl UnwindSafe for PropagatorContext
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more