http-type 23.2.0

A comprehensive Rust type library for HTTP operations and concurrent programming. Provides core HTTP types (Request/Response with builder patterns, Method, HttpStatus, HttpVersion, ContentType, FileExtension with MIME mapping, Cookie parsing/building, HttpUrl parsing, WebSocket frame/opcode, protocol upgrade types, stream/task management, panic handling), thread-safe concurrent wrappers (ArcMutex, ArcRwLock, BoxRwLock, RcRwLock), dynamic dispatch types (BoxAny, RcAny, ArcAny with Send/Sync variants), high-performance hash collections (HashMapXxHash3_64, HashSetXxHash3_64), and static lifetime utilities (BoxLeak, Lifetime trait).
Documentation
use super::*;

/// Result of inspecting buffered or freshly read WebSocket wire bytes.
pub(crate) enum WebSocketParseStep {
    /// More bytes must be read from the transport before a frame completes.
    NeedMore,
    /// Peer closed the transport cleanly with zero bytes read.
    Eof,
    /// A complete data message payload was reassembled and validated.
    Message(Vec<u8>),
    /// A control ping frame arrived and requires a matching pong reply.
    Ping(Vec<u8>),
}

/// Reusable connection-scoped timeout slot shared between HTTP/1.1 and WebSocket idle waits.
#[derive(Debug)]
pub(super) enum StreamTimer {
    /// No active timer allocated.
    None,
    /// Reusable Tokio `Sleep` timer used by HTTP/1.1 keep-alive and short sub-second timeouts.
    Sleep(Pin<Box<Sleep>>),
    /// Shared staggered heartbeat receiver used by long-lived idle WebSocket connections.
    WsHeartbeat {
        /// Shared phase-bucketed watch receiver firing once per adjusted timeout interval.
        rx: Receiver<u64>,
        /// Interval in milliseconds for which `rx` was subscribed.
        interval_ms: u64,
    },
}

/// Outcome of the zero-pool stack-buffer HTTP/1.1 read fast path.
pub(super) enum FastHttpRead {
    /// Complete request head and body were parsed with no unread trailing bytes.
    Complete,
    /// Complete request head and body were parsed; trailing pipelined bytes were moved to `leftover`.
    CompleteWithLeftover(Vec<u8>, usize, usize),
    /// Head was parsed, but fixed-length or chunked body still needs incremental reading.
    BodyPending(RequestFraming, Vec<u8>, usize),
    /// Buffered bytes did not yet contain the full header block; fall back to incremental reader.
    IncompleteHead(Vec<u8>, usize),
}