Struct build_fs_tree::MergeableFileSystemTree [−][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.
Generic parameters:
Path
: Reference to a file in the filesystem.FileContent
: Content of a file.
Difference from FileSystemTree
:
FileSystemTree::build
cannot write over an existing directory.
On the other hand, MergeableFileSystemTree::build
either merges
the two directories if there’s no conflict.
Methods from Deref<Target = FileSystemTree<Path, FileContent>>
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,
impl<Path, FileContent> AsRef<FileSystemTree<Path, FileContent>> for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src][+]
Path: Ord,
impl<Name, FileContent> Build<Name, Error> for MergeableFileSystemTree<Name, FileContent> where
Name: AsRef<Path> + Ord,
FileContent: AsRef<[u8]>,
[src][+]
Name: AsRef<Path> + Ord,
FileContent: AsRef<[u8]>,
impl<Path: Clone, FileContent: Clone> Clone for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src][+]
Path: Ord,
impl<Path: Debug, FileContent: Debug> Debug for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src][+]
Path: Ord,
impl<Path, FileContent> Deref for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src][+]
Path: Ord,
impl<Path, FileContent> DerefMut for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src][+]
Path: Ord,
impl<'de, Path, FileContent> Deserialize<'de> for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
Path: Deserialize<'de>,
FileContent: Deserialize<'de>,
[src][+]
Path: Ord,
Path: Deserialize<'de>,
FileContent: Deserialize<'de>,
impl<Path: Eq, FileContent: Eq> Eq for MergeableFileSystemTree<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,
impl<Path, FileContent> From<MergeableFileSystemTree<Path, FileContent>> for FileSystemTree<Path, FileContent> where
Path: Ord,
[src][+]
Path: Ord,
impl<Path, FileContent> Node for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src][+]
Path: Ord,
impl<Path: PartialEq, FileContent: PartialEq> PartialEq<MergeableFileSystemTree<Path, FileContent>> for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src][+]
Path: Ord,
impl<Path, FileContent> Serialize for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
Path: Serialize,
FileContent: Serialize,
[src][+]
Path: Ord,
Path: Serialize,
FileContent: Serialize,
impl<Path, FileContent> StructuralEq for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
impl<Path, FileContent> StructuralPartialEq for MergeableFileSystemTree<Path, FileContent> where
Path: Ord,
[src]
Path: Ord,
Auto Trait Implementations
impl<Path, FileContent> RefUnwindSafe for MergeableFileSystemTree<Path, FileContent> where
FileContent: RefUnwindSafe,
Path: RefUnwindSafe,
FileContent: RefUnwindSafe,
Path: RefUnwindSafe,
impl<Path, FileContent> Send for MergeableFileSystemTree<Path, FileContent> where
FileContent: Send,
Path: Send,
FileContent: Send,
Path: Send,
impl<Path, FileContent> Sync for MergeableFileSystemTree<Path, FileContent> where
FileContent: Sync,
Path: Sync,
FileContent: Sync,
Path: Sync,
impl<Path, FileContent> Unpin for MergeableFileSystemTree<Path, FileContent> where
FileContent: Unpin,
FileContent: Unpin,
impl<Path, FileContent> UnwindSafe for MergeableFileSystemTree<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,
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][+]
impl<X> Pipe for X
[src][+]
impl<T> ToOwned for T where
T: Clone,
[src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,