hyperlane 19.1.0

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 errors that can occur at the server level.
#[derive(Clone, CustomDebug, Deserialize, DisplayDebug, Eq, PartialEq, Serialize)]
pub enum ServerError {
    /// An error occurred while trying to bind to a TCP socket.
    TcpBind(String),
    /// An unknown or unexpected error occurred.
    Unknown(String),
    /// An error occurred while reading an HTTP request.
    HttpRead(String),
    /// The received HTTP request was invalid or malformed.
    InvalidHttpRequest(Request),
    /// Other error.
    Other(String),
}

/// Represents errors related to route definitions and matching.
#[derive(Clone, CustomDebug, Deserialize, DisplayDebug, Eq, PartialEq, Serialize)]
pub enum RouteError {
    /// The route pattern cannot be empty.
    EmptyPattern,
    /// A route with the same pattern has already been defined.
    DuplicatePattern(String),
    /// The provided route pattern is not a valid regular expression.
    InvalidRegexPattern(String),
}