Skip to main content

hyperlane_core/context/
struct.rs

1use super::*;
2
3/// Represents the internal state of the application context.
4///
5/// This structure holds all the data associated with a single request-response cycle,
6/// including the request, response, and any custom attributes.
7#[derive(Clone, CustomDebug, Data, DisplayDebug)]
8pub struct Context {
9    /// The incoming HTTP request.
10    pub(super) request: Request,
11    /// The outgoing HTTP response.
12    pub(super) response: Response,
13    /// Parameters extracted from the route path.
14    #[get_mut(skip)]
15    pub(super) route_params: RouteParams,
16    /// A collection of custom attributes for sharing data within the request lifecycle.
17    pub(super) attributes: ThreadSafeAttributeStore,
18}