Trait build_fs_tree::Build
source · [−]pub trait Build<Name, Error>: Node + Sizedwhere
Self::DirectoryContent: IntoIterator<Item = (Name, Self)>,
Error: Display,{
type Path: Debug + 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>> { ... }
}
Expand description
Applying FileSystemTree
to the filesystem.
Generic parameters:
Name
: Identification of a child item.Error
: Error type used by the other functions.
Required Associated Types
Required Methods
sourcefn write_file(
path: &Self::Path,
content: &Self::FileContent
) -> Result<(), Error>
fn write_file(
path: &Self::Path,
content: &Self::FileContent
) -> Result<(), Error>
Write content to a file.
sourcefn create_dir(path: &Self::Path) -> Result<(), Error>
fn create_dir(path: &Self::Path) -> Result<(), Error>
Create a directory at root.