http-type 20.0.5

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 crate::*;

#[test]
fn test_lifetime_trait_leak() {
    let data: TestLifetimeStruct = TestLifetimeStruct { value: 42 };
    let leaked: &'static TestLifetimeStruct = unsafe { data.leak() };
    assert_eq!(leaked.value, 42);
}

#[test]
fn test_lifetime_trait_leak_mut() {
    let data: TestLifetimeStruct = TestLifetimeStruct { value: 10 };
    let leaked: &'static mut TestLifetimeStruct = unsafe { data.leak_mut() };
    assert_eq!(leaked.value, 10);
    leaked.value = 99;
    assert_eq!(leaked.value, 99);
}

#[test]
fn test_lifetime_trait_leak_preserves_value() {
    let data: TestLifetimeStruct = TestLifetimeStruct { value: 100 };
    let leaked: &'static TestLifetimeStruct = unsafe { data.leak() };
    assert_eq!(leaked.value, 100);
}