proxmox/proxmox-io/src/lib.rs
Wolfgang Bumiller 2610208794 io: add boxed module for boxed bytes like vec::zeroed...
- proxmox_io::boxed::uninitialized(len) -> Box<[u8]>
  same as vec::uninitialized, but as a box

- proxmox_io::boxed::zeroed(len) -> Box<[u8]>
  same as vec::zeroed, but as a box

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-12-12 11:00:22 +01:00

28 lines
601 B
Rust

//! Module providing I/O helpers (sync and async).
//!
//! The [`ReadExt`] trait provides additional operations for handling byte buffers for types
//! implementing [`Read`](std::io::Read).
#![deny(unsafe_op_in_unsafe_fn)]
mod read;
pub use read::ReadExt;
mod write;
pub use write::WriteExt;
mod sparse_copy;
pub use sparse_copy::{buffer_is_zero, sparse_copy, SparseCopyResult};
#[cfg(feature = "tokio")]
pub use sparse_copy::sparse_copy_async;
mod std_channel_writer;
pub use std_channel_writer::StdChannelWriter;
mod byte_buffer;
pub use byte_buffer::ByteBuffer;
pub mod boxed;
pub mod vec;