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 dataByteStr- 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 operationsRe-exports§
pub use futures_lite::AsyncBufRead;pub use futures_lite::AsyncBufReadExt;pub use futures_lite::AsyncRead;pub use futures_lite::AsyncReadExt;pub use futures_lite::AsyncSeek;pub use futures_lite::AsyncSeekExt;pub use futures_lite::AsyncWrite;pub use futures_lite::AsyncWriteExt;pub use futures_lite::Future;pub use futures_lite::FutureExt;pub use futures_lite::Stream;pub use futures_lite::StreamExt;
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.