Context

Type Alias Context 

Source
pub type Context = RequestContext;
Expand description

Alias for RequestContext for backward compatibility

Aliased Type§

pub struct Context {
    pub request_id: String,
    pub user_id: Option<String>,
    pub session_id: Option<String>,
    pub client_id: Option<String>,
    pub timestamp: Timestamp,
    pub start_time: Instant,
    pub metadata: Arc<HashMap<String, Value>>,
    pub cancellation_token: Option<Arc<CancellationToken>>,
    /* private fields */
}

Fields§

§request_id: String

A unique identifier for the request, typically a UUID.

§user_id: Option<String>

The identifier for the user making the request, if authenticated.

§session_id: Option<String>

The identifier for the session to which this request belongs.

§client_id: Option<String>

The identifier for the client application making the request.

§timestamp: Timestamp

The timestamp when the request was received.

§start_time: Instant

The Instant when request processing started, used for performance tracking.

§metadata: Arc<HashMap<String, Value>>

A collection of custom metadata for application-specific use cases.

§cancellation_token: Option<Arc<CancellationToken>>

A token that can be used to signal cancellation of the request.