pub struct RequestScope {
pub correlation_id: CorrelationId,
pub created_at: SystemTime,
pub parent_correlation_id: Option<CorrelationId>,
pub metadata: HashMap<String, String>,
pub span: Option<Span>,
}
Expand description
Request scope information for context inheritance
Fields§
§correlation_id: CorrelationId
Unique correlation ID for this request chain
created_at: SystemTime
When this request scope was created
parent_correlation_id: Option<CorrelationId>
Parent correlation ID if this is a child request
metadata: HashMap<String, String>
Request metadata for observability
span: Option<Span>
Tracing span for this request
Implementations§
Source§impl RequestScope
impl RequestScope
Sourcepub fn create_child(&self) -> Self
pub fn create_child(&self) -> Self
Create a child request scope
Sourcepub fn with_metadata(self, key: String, value: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Add metadata to this request scope
Trait Implementations§
Source§impl Clone for RequestScope
impl Clone for RequestScope
Source§fn clone(&self) -> RequestScope
fn clone(&self) -> RequestScope
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 moreAuto Trait Implementations§
impl Freeze for RequestScope
impl !RefUnwindSafe for RequestScope
impl Send for RequestScope
impl Sync for RequestScope
impl Unpin for RequestScope
impl !UnwindSafe for RequestScope
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