2019-08-16 10:27:17 +00:00
|
|
|
//! Trait for file list catalog
|
2019-08-09 06:11:32 +00:00
|
|
|
//!
|
|
|
|
//! A file list catalog simply store a directory tree. Such catalogs
|
|
|
|
//! may be used as index to do a fast search for files.
|
|
|
|
|
2020-04-17 12:11:25 +00:00
|
|
|
use anyhow::{Error};
|
2019-08-16 10:27:17 +00:00
|
|
|
use std::ffi::CStr;
|
2019-11-11 13:19:54 +00:00
|
|
|
|
2019-08-09 06:11:32 +00:00
|
|
|
pub trait BackupCatalogWriter {
|
|
|
|
fn start_directory(&mut self, name: &CStr) -> Result<(), Error>;
|
|
|
|
fn end_directory(&mut self) -> Result<(), Error>;
|
2020-10-22 07:05:37 +00:00
|
|
|
fn add_file(&mut self, name: &CStr, size: u64, mtime: i64) -> Result<(), Error>;
|
2019-08-09 06:11:32 +00:00
|
|
|
fn add_symlink(&mut self, name: &CStr) -> Result<(), Error>;
|
|
|
|
fn add_hardlink(&mut self, name: &CStr) -> Result<(), Error>;
|
|
|
|
fn add_block_device(&mut self, name: &CStr) -> Result<(), Error>;
|
|
|
|
fn add_char_device(&mut self, name: &CStr) -> Result<(), Error>;
|
|
|
|
fn add_fifo(&mut self, name: &CStr) -> Result<(), Error>;
|
|
|
|
fn add_socket(&mut self, name: &CStr) -> Result<(), Error>;
|
|
|
|
}
|