Module utils

Module utils 

Source
Expand description

Utility types and functions for HTTP operations.

This module provides convenient re-exports of commonly used types and utilities that are helpful when working with HTTP requests, responses, and async operations. These re-exports save you from having to import these dependencies directly.

§Exported Types

  • Bytes - Efficient byte buffer for HTTP body data
  • ByteStr - UTF-8 validated byte string for text content
  • All items from futures_lite - Async utilities and traits

§Examples

§Working with Bytes

use http_kit::utils::Bytes;

let data = Bytes::from("Hello, world!");
assert_eq!(data.len(), 13);

§Working with ByteStr

use http_kit::utils::ByteStr;

let text = ByteStr::from_static("Hello, world!");
assert_eq!(text.as_str(), "Hello, world!");

§Async Operations

use http_kit::utils::{AsyncReadExt, AsyncWriteExt};

// Use async I/O traits for streaming operations

Modules§

future
Complete async runtime utilities and traits.
io
Complete async runtime utilities and traits.
prelude
Complete async runtime utilities and traits.
stream
Complete async runtime utilities and traits.

Macros§

pin
Complete async runtime utilities and traits.
ready
Complete async runtime utilities and traits.

Structs§

ByteStr
UTF-8 validated byte string optimized for text content.
Bytes
Efficient, reference-counted byte buffer for HTTP body data.

Traits§

AsyncBufRead
Complete async runtime utilities and traits.
AsyncBufReadExt
Complete async runtime utilities and traits.
AsyncRead
Complete async runtime utilities and traits.
AsyncReadExt
Complete async runtime utilities and traits.
AsyncSeek
Complete async runtime utilities and traits.
AsyncSeekExt
Complete async runtime utilities and traits.
AsyncWrite
Complete async runtime utilities and traits.
AsyncWriteExt
Complete async runtime utilities and traits.
Future
Complete async runtime utilities and traits.
FutureExt
Complete async runtime utilities and traits.
Stream
Complete async runtime utilities and traits.
StreamExt
Complete async runtime utilities and traits.