Enum build_fs_tree::FileSystemTree [−][src]
Representation of a filesystem which contains only files and directories.
The serialization of FileContent
(content of file) and BTreeMap<Path, Self>
(children of directory) must not share the same type. That is, FileContent
must
be serialized to things other than a dictionary.
Note: FileSystemTree::build
cannot write over an existing
directory. Use MergeableFileSystemTree
instead if you desire such behavior.
Generic parameters:
Path
: Reference to a file in the filesystem.FileContent
: Content of a file.
Variants
Represents a file with its content.
Its YAML representation must not have the same type as FileSystemTree::Directory
’s.
Directory(BTreeMap<Path, Self>)
Represents a directory with its children.
It is a set of name-to-subtree mappings.
Its YAML representation must not have the same type as FileSystemTree::File
’s.
Implementations
impl<Path, FileContent> FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
pub fn file_content(&self) -> Option<&FileContent>
[src]
Get immutable reference to the file content.
pub fn dir_content(&self) -> Option<&BTreeMap<Path, Self>>
[src]
Get immutable reference to the directory content.
pub fn path<'a>(
&'a self,
path: &'a mut impl Iterator<Item = &'a Path>
) -> Option<&'a Self>
[src]
&'a self,
path: &'a mut impl Iterator<Item = &'a Path>
) -> Option<&'a Self>
Get immutable reference to a descendant of any level.
pub fn file_content_mut(&mut self) -> Option<&mut FileContent>
[src]
Get mutable reference to the file content.
pub fn dir_content_mut(&mut self) -> Option<&mut BTreeMap<Path, Self>>
[src]
Get mutable reference to the directory content.
pub fn path_mut<'a>(
&'a mut self,
path: &'a mut impl Iterator<Item = &'a Path>
) -> Option<&'a mut Self>
[src]
&'a mut self,
path: &'a mut impl Iterator<Item = &'a Path>
) -> Option<&'a mut Self>
Get mutable reference to a descendant of any level.
Trait Implementations
impl<Path, FileContent> AsMut<FileSystemTree<Path, FileContent>> for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
fn as_mut(&mut self) -> &mut FileSystemTree<Path, FileContent>
[src]
impl<Path, FileContent> AsRef<FileSystemTree<Path, FileContent>> for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
fn as_ref(&self) -> &FileSystemTree<Path, FileContent>
[src]
impl<Name, FileContent> Build<Name, Error> for FileSystemTree<Name, FileContent> where
Name: AsRef<Path> + Ord,
FileContent: AsRef<[u8]>,
[src]
Name: AsRef<Path> + Ord,
FileContent: AsRef<[u8]>,
type Path = PathBuf
Locations of the items in the filesystem.
fn join(prefix: &Self::Path, name: &Name) -> Self::Path
[src]
fn write_file(
path: &Self::Path,
content: &Self::FileContent
) -> Result<(), Error>
[src]
path: &Self::Path,
content: &Self::FileContent
) -> Result<(), Error>
fn create_dir(path: &Self::Path) -> Result<(), Error>
[src]
fn build(self, path: &Self::Path) -> Result<(), BuildError<Self::Path, Error>>
[src]
impl<Path: Clone, FileContent: Clone> Clone for FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
fn clone(&self) -> FileSystemTree<Path, FileContent>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<Path: Debug, FileContent: Debug> Debug for FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
impl<'de, Path, FileContent> Deserialize<'de> for FileSystemTree<Path, FileContent> where
Path: Ord,
Path: Deserialize<'de>,
FileContent: Deserialize<'de>,
[src]
Path: Ord,
Path: Deserialize<'de>,
FileContent: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<Path: Eq, FileContent: Eq> Eq for FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
impl<Path, FileContent> From<FileSystemTree<Path, FileContent>> for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
fn from(
original: FileSystemTree<Path, FileContent>
) -> MergeableFileSystemTree<Path, FileContent>
[src]
original: FileSystemTree<Path, FileContent>
) -> MergeableFileSystemTree<Path, FileContent>
impl<Path, FileContent> From<MergeableFileSystemTree<Path, FileContent>> for FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
fn from(original: MergeableFileSystemTree<Path, FileContent>) -> Self
[src]
impl<Path, FileContent> Node for FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
type FileContent = FileContent
Content of the node if it is a file.
type DirectoryContent = BTreeMap<Path, Self>
Content of the node if it is a directory.
fn read(self) -> NodeContent<FileContent, Self::DirectoryContent>
[src]
impl<Path: PartialEq, FileContent: PartialEq> PartialEq<FileSystemTree<Path, FileContent>> for FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
fn eq(&self, other: &FileSystemTree<Path, FileContent>) -> bool
[src]
fn ne(&self, other: &FileSystemTree<Path, FileContent>) -> bool
[src]
impl<Path, FileContent> Serialize for FileSystemTree<Path, FileContent> where
Path: Ord,
Path: Serialize,
FileContent: Serialize,
[src]
Path: Ord,
Path: Serialize,
FileContent: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<Path, FileContent> StructuralEq for FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
impl<Path, FileContent> StructuralPartialEq for FileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
Auto Trait Implementations
impl<Path, FileContent> RefUnwindSafe for FileSystemTree<Path, FileContent> where
FileContent: RefUnwindSafe,
Path: RefUnwindSafe,
FileContent: RefUnwindSafe,
Path: RefUnwindSafe,
impl<Path, FileContent> Send for FileSystemTree<Path, FileContent> where
FileContent: Send,
Path: Send,
FileContent: Send,
Path: Send,
impl<Path, FileContent> Sync for FileSystemTree<Path, FileContent> where
FileContent: Sync,
Path: Sync,
FileContent: Sync,
Path: Sync,
impl<Path, FileContent> Unpin for FileSystemTree<Path, FileContent> where
FileContent: Unpin,
FileContent: Unpin,
impl<Path, FileContent> UnwindSafe for FileSystemTree<Path, FileContent> where
FileContent: RefUnwindSafe + UnwindSafe,
Path: RefUnwindSafe,
FileContent: RefUnwindSafe + UnwindSafe,
Path: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<X> Pipe for X
[src]
pub fn pipe<Return, Function>(self, f: Function) -> Return where
Function: FnOnce(Self) -> Return,
[src]
Function: FnOnce(Self) -> Return,
pub fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
Function: FnOnce(&'a Self) -> Return,
[src]
Function: FnOnce(&'a Self) -> Return,
pub fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
Function: FnOnce(&'a mut Self) -> Return,
[src]
Function: FnOnce(&'a mut Self) -> Return,
pub fn pipe_as_ref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
[src]
Self: AsRef<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
pub fn pipe_as_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: AsMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
[src]
&'a mut self,
f: Function
) -> Return where
Self: AsMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
pub fn pipe_deref<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
[src]
Self: Deref<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
pub fn pipe_deref_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
[src]
&'a mut self,
f: Function
) -> Return where
Self: DerefMut<Target = Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
pub fn pipe_borrow<'a, Param, Return, Function>(&'a self, f: Function) -> Return where
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
[src]
Self: Borrow<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a Param) -> Return,
pub fn pipe_borrow_mut<'a, Param, Return, Function>(
&'a mut self,
f: Function
) -> Return where
Self: BorrowMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
[src]
&'a mut self,
f: Function
) -> Return where
Self: BorrowMut<Param>,
Param: 'a + ?Sized,
Function: FnOnce(&'a mut Param) -> Return,
impl<X> Pipe for X
[src]
pub fn pipe<Return, Function>(self, f: Function) -> Return where
Function: FnOnce(Self) -> Return,
[src]
Function: FnOnce(Self) -> Return,
pub fn pipe_ref<'a, Return, Function>(&'a self, f: Function) -> Return where
Function: FnOnce(&'a Self) -> Return,
[src]
Function: FnOnce(&'a Self) -> Return,
pub fn pipe_mut<'a, Return, Function>(&'a mut self, f: Function) -> Return where
Function: FnOnce(&'a mut Self) -> Return,
[src]
Function: FnOnce(&'a mut Self) -> Return,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,