pub trait Backend {
    type FileName: AsRef<Path>;
    type FileNameIter: IntoIterator<Item = Self::FileName>;
    type FileStream: Read;

    // Required methods
    fn file_names(&self) -> Result<Self::FileNameIter>;
    fn open_file(&self, name: &Path) -> Result<Self::FileStream>;
}
Expand description

A trait used to provide a transport layer for backup files.

Required Associated Types§

source

type FileName: AsRef<Path>

A file name. It must be convertible to a Path.

source

type FileNameIter: IntoIterator<Item = Self::FileName>

An iterator over filenames.

source

type FileStream: Read

A file managed by the backend. It must implement the Read trait.

Required Methods§

source

fn file_names(&self) -> Result<Self::FileNameIter>

Returns a list of available file names.

The file names returned should have an extension, and do not contain the base path.

source

fn open_file(&self, name: &Path) -> Result<Self::FileStream>

Opens a file for reading.

Implementors§