hyperlane 20.0.1

A lightweight, high-performance, and cross-platform Rust HTTP server library built on Tokio. It simplifies modern web service development by providing built-in support for middleware, WebSocket, Server-Sent Events (SSE), and raw TCP communication. With a unified and ergonomic API across Windows, Linux, and MacOS, it enables developers to build robust, scalable, and event-driven network applications with minimal overhead and maximum flexibility.
Documentation
use crate::*;

/// Represents the internal state of the application context.
///
/// This structure holds all the data associated with a single request-response cycle,
/// including the stream, request, response, and any custom attributes.
#[derive(Clone, CustomDebug, Data, DisplayDebug)]
pub struct Context {
    /// A flag indicating whether the request handling has been aborted.
    #[get(type(copy))]
    pub(super) aborted: bool,
    /// A flag indicating whether the connection has been closed.
    #[get(type(copy))]
    pub(super) closed: bool,
    /// The underlying network stream for the connection.
    #[get_mut(skip)]
    #[set(pub(super))]
    pub(super) stream: Option<ArcRwLockStream>,
    /// The incoming HTTP request.
    #[get_mut(skip)]
    #[set(pub(crate))]
    pub(super) request: Request,
    /// The outgoing HTTP response.
    pub(super) response: Response,
    /// Parameters extracted from the route path.
    #[get_mut(skip)]
    #[set(pub(crate))]
    pub(super) route_params: RouteParams,
    /// A collection of custom attributes for sharing data within the request lifecycle.
    #[get_mut(pub(super))]
    #[set(pub(crate))]
    pub(super) attributes: ThreadSafeAttributeStore,
    /// The server for accessing server-wide configuration and state.
    #[get_mut(skip)]
    #[set(pub(super))]
    pub(super) server: &'static Server,
}