io-buffer
This crate provide a 16 Bytes [Buffer] type, to unify the difference of different types of buffer, for disk and network IO:
-
max buffer size 1 << 31,
-
Converts owned buffer,
From<Vec<u8>>andTo<Vec<u8>>. -
Allocation with malloc()
-
Allocation with posix_memalign()
-
Converts from const reference, or from mutable reference of unsafe c code.
On debug mode, provides runtime checking if you try to as_mut() a const buffer.
Usage
Cargo.toml:
[]
= "1"
Feature flags
-
compress: enable [Compression] trait
-
lz4: enable lz4 compression
-
rand: enable
rand_buffer()function -
fail: enable
failinjection point "alloc_buf" of return buffer allocate with random uninit content