io_buffer/
lib.rs

1//! # io-buffer
2//!
3//! This crate provide a [Buffer] type, to unify the difference of different types of buffer,
4//! for disk and network IO:
5//!
6//! * Converts owned buffer, `From<Vec<u8>>` and `To<Vec<u8>>`.
7//!
8//! * Allocation with [malloc()](Buffer::alloc())
9//!
10//! * Allocation with [posix_memalign()](Buffer::aligned())
11//!
12//! * Converts from [const reference](Buffer::from_c_ref_const()),  or from
13//! [mutable reference](Buffer::from_c_ref_mut()) of unsafe c code.
14//!
15//! On debug mode, provides runtime checking if you try to as_mut() a const buffer.
16//!
17
18extern crate log;
19#[macro_use]
20extern crate captains_log;
21
22mod buffer;
23mod utils;
24
25pub use buffer::{Buffer, MAX_BUFFER_SIZE};
26pub use utils::*;
27
28#[cfg(feature = "compress")]
29pub mod compress;
30
31#[cfg(test)]
32mod test;