Trait build_fs_tree::Build[][src]

pub trait Build<Name, Error>: Node + Sized where
    Self::DirectoryContent: IntoIterator<Item = (Name, Self)>, 
{ type Path: Clone; fn join(prefix: &Self::Path, name: &Name) -> Self::Path;
fn write_file(
        path: &Self::Path,
        content: &Self::FileContent
    ) -> Result<(), Error>;
fn create_dir(path: &Self::Path) -> Result<(), Error>; fn build(
        self,
        path: &Self::Path
    ) -> Result<(), BuildError<Self::Path, Error>> { ... } }

Applying FileSystemTree to the filesystem.

Generic parameters:

  • Name: Identification of a child item.
  • Error: Error type used by the other functions.

Associated Types

type Path: Clone[src]

Locations of the items in the filesystem.

Loading content...

Required methods

fn join(prefix: &Self::Path, name: &Name) -> Self::Path[src]

Add prefix to the root of the tree.

fn write_file(
    path: &Self::Path,
    content: &Self::FileContent
) -> Result<(), Error>
[src]

Write content to a file.

fn create_dir(path: &Self::Path) -> Result<(), Error>[src]

Create a directory at root.

Loading content...

Provided methods

fn build(self, path: &Self::Path) -> Result<(), BuildError<Self::Path, Error>>[src]

Build the tree into the filesystem.

Loading content...

Implementors

impl<Name, FileContent> Build<Name, Error> for FileSystemTree<Name, FileContent> where
    Name: AsRef<Path> + Ord,
    FileContent: AsRef<[u8]>, 
[src]

type Path = PathBuf

impl<Name, FileContent> Build<Name, Error> for MergeableFileSystemTree<Name, FileContent> where
    Name: AsRef<Path> + Ord,
    FileContent: AsRef<[u8]>, 
[src]

type Path = PathBuf

Loading content...