Trait tbf::FileSystem[][src]

pub trait FileSystem {
    type Error;
    fn add_file<I>(&self, data: &[u8], tags: I) -> Result<FileId, Self::Error>
    where
        I: IntoIterator<Item = Tag>
;
fn edit_file<I>(
        &self,
        id: FileId,
        data: Option<&[u8]>,
        tags: Option<I>
    ) -> Result<(), Self::Error>
    where
        I: IntoIterator<Item = Tag>
;
fn remove_file(&self, id: FileId) -> Result<(), Self::Error>;
fn search_tags<P>(&self, tags: P) -> Result<Vec<FileId>, Self::Error>
    where
        P: TagPattern
;
fn get_info(&self, id: FileId) -> Result<FileInfo, Self::Error>; }
Expand description

A trait representing an implementation of a tag-based filesystem.

Associated Types

The error type to use with this filesystem.

Required methods

Add a new file with the given data and tags

Edit an existing file, altering the data or tags

Remove an existing file

Search for files matching a given tag pattern

Get info about an existing file

Implementors