Skip to content

NaturalIO/io-buffer-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

io-buffer

Build Status Cargo Documentation Rust 1.36+

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>> and To<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:

[dependencies]
io-buffer = "1"

Feature flags

  • compress: enable [Compression] trait

  • lz4: enable lz4 compression

  • rand: enable rand_buffer() function

  • fail: enable fail injection point "alloc_buf" of return buffer allocate with random uninit content

About

Abstract buffer type for disk and network IO

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors