]> git.proxmox.com Git - proxmox-backup.git/blob - src/pxar/catalog.rs
96b424271867881faa47bdc5e23b0cbfc5b4d9f2
[proxmox-backup.git] / src / pxar / catalog.rs
1 //! Trait for file list catalog
2 //!
3 //! A file list catalog simply store a directory tree. Such catalogs
4 //! may be used as index to do a fast search for files.
5
6 use anyhow::{Error};
7 use std::ffi::CStr;
8
9 pub trait BackupCatalogWriter {
10 fn start_directory(&mut self, name: &CStr) -> Result<(), Error>;
11 fn end_directory(&mut self) -> Result<(), Error>;
12 fn add_file(&mut self, name: &CStr, size: u64, mtime: u64) -> Result<(), Error>;
13 fn add_symlink(&mut self, name: &CStr) -> Result<(), Error>;
14 fn add_hardlink(&mut self, name: &CStr) -> Result<(), Error>;
15 fn add_block_device(&mut self, name: &CStr) -> Result<(), Error>;
16 fn add_char_device(&mut self, name: &CStr) -> Result<(), Error>;
17 fn add_fifo(&mut self, name: &CStr) -> Result<(), Error>;
18 fn add_socket(&mut self, name: &CStr) -> Result<(), Error>;
19 }