pub mod cpio;
pub mod daemon;
pub mod disks;
-pub mod fuse_loop;
mod memcom;
pub use memcom::Memcom;
pub mod logrotate;
-pub mod loopdev;
pub mod serde_filter;
pub mod statistics;
pub mod subscription;
pub mod systemd;
pub mod ticket;
pub mod sgutils2;
-pub mod paperkey;
pub mod parallel_handler;
pub use parallel_handler::ParallelHandler;
pub use pbs_tools::broadcast_future::{BroadcastData, BroadcastFuture};
pub use pbs_tools::ops::ControlFlow;
-/// The `BufferedRead` trait provides a single function
-/// `buffered_read`. It returns a reference to an internal buffer. The
-/// purpose of this traid is to avoid unnecessary data copies.
-pub trait BufferedRead {
- /// This functions tries to fill the internal buffers, then
- /// returns a reference to the available data. It returns an empty
- /// buffer if `offset` points to the end of the file.
- fn buffered_read(&mut self, offset: u64) -> Result<&[u8], Error>;
-}
-
/// Shortcut for md5 sums.
pub fn md5sum(data: &[u8]) -> Result<DigestBytes, Error> {
hash(MessageDigest::md5(), data).map_err(Error::from)
Ok(())
}
-/// safe wrapper for `nix::unistd::pipe2` defaulting to `O_CLOEXEC` and guarding the file
-/// descriptors.
-pub fn pipe() -> Result<(Fd, Fd), Error> {
- let (pin, pout) = nix::unistd::pipe2(nix::fcntl::OFlag::O_CLOEXEC)?;
- Ok((Fd(pin), Fd(pout)))
-}
-
/// safe wrapper for `nix::sys::socket::socketpair` defaulting to `O_CLOEXEC` and guarding the file
/// descriptors.
pub fn socketpair() -> Result<(Fd, Fd), Error> {