bufkit 0.3.2

Providing `Buf` and `BufMut` for working with byte buffers. `bufkit` focuses on predictable memory usage and comprehensive error handling.
Documentation
bufkit-0.3.2 has been yanked.

Providing Buf and BufMut for working with byte buffers. bufkit focuses on predictable memory usage and comprehensive error handling.

Features

bufkit prioritizes explicit control and detailed error reporting, making it suitable for applications where memory behavior must be predictable and errors need comprehensive handling.

  • Multiple error handling strategies - Choose between panicking, Option, or detailed Result types
  • Buffer segmentation - Create independent views of buffer data
  • Offset operations - Built-in methods for writing/reading at specific positions
  • Embedded friendly - Support both no-alloc and no-std.
  • Sans-I/O friendly - Works purely on memory buffers without hidden allocations or I/O operations, providing predictable behavior and detailed error information that helps with protocol state management and partial data handling
    • No hidden allocations - Write operations work directly on provided memory
    • Retry-friendly - try_* methods provide detailed error information (requested vs available bytes) enabling robust retry logic and graceful error recovery

Installation

[dependencies]
bufkit = "0.3"
  • Enable LEB128 encoding/decoding methods

    [dependencies]
    bufkit = { version = "0.3", features = ["varing"] }
    

Alternatives

  • bytes::{Buf, BufMut}: Buffer traits for the bytes may or may not be stored in contiguous memory.
  • buffer-trait: A Buffer trait for reading into uninitialized buffers.

License

bufkit is under the terms of both the MIT license and the Apache License (Version 2.0).

See LICENSE-APACHE, LICENSE-MIT for details.

Copyright (c) 2025 Al Liu.