hyperlane-core 23.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 super::*;

/// Zero-allocation HTTP/2 DATA payload buffer avoiding `Bytes` heap copies on the hot path.
pub(crate) enum H2BodyBuf {
    /// Empty DATA payload used for bare end-of-stream frames.
    Empty,
    /// Small response payload stored inline with zero heap allocation or zero-initialization.
    Inline {
        /// Uninitialized inline byte storage up to [`H2_INLINE_BODY_CAP`] bytes.
        data: [MaybeUninit<u8>; H2_INLINE_BODY_CAP],
        /// Current unread cursor inside `data`.
        pos: u8,
        /// Total initialized byte count inside `data`.
        len: u8,
    },
    /// Larger response payload backed by a worker-local pooled `Vec<u8>`.
    Pooled {
        /// Pooled heap buffer returned to [`H2_BODY_POOL`] on drop.
        buf: Vec<u8>,
        /// Current unread cursor inside `buf`.
        pos: usize,
    },
}