Crate io_buffer

Source
Expand description

§io-buffer

This crate provide a Buffer type, to unify the difference of different types of buffer, for disk and network IO:

On debug mode, provides runtime checking if you try to as_mut() a const buffer.

§Usage

Cargo.toml:

[dependencies]
io-buffer = "1"

§Feature flags

  • compress: enable [Compression] trait

  • lz4: enable lz4 compression

Modules§

compress
Enabled with feature compress

Structs§

Buffer
Buffer is a static type, size and cap (max to u32). Memory footprint is only 16B.

Constants§

MAX_BUFFER_SIZE

Functions§

is_all_zero
Test whether a buffer is all set to zero
rand_buffer
Produce ascii random string
safe_copy
safe_copy regardless the size of buffer.
set_zero
Set a buffer to zero