]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/tools/mod.rs
move remaining client tools to pbs-tools/datastore
[proxmox-backup.git] / src / tools / mod.rs
index 2d2d923ab4d5ae74777f52918f535ad64fbe4358..b6c55ac2724141e01dbfae4272f0c4e2906a330a 100644 (file)
@@ -30,20 +30,17 @@ pub mod config;
 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;
@@ -54,16 +51,6 @@ pub use file_logger::{FileLogger, FileLogOptions};
 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)
@@ -174,13 +161,6 @@ pub fn fail_on_shutdown() -> Result<(), Error> {
     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> {