Struct build_fs_tree::MergeableFileSystemTree[][src]

pub struct MergeableFileSystemTree<Path, FileContent>(_)
where
    Path: Ord
;

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]

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]

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]

impl<Path, FileContent> AsRef<FileSystemTree<Path, FileContent>> for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

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

type Path = PathBuf

Locations of the items in the filesystem.

impl<Path: Clone, FileContent: Clone> Clone for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

impl<Path: Debug, FileContent: Debug> Debug for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

impl<Path, FileContent> Deref for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

type Target = FileSystemTree<Path, FileContent>

The resulting type after dereferencing.

impl<Path, FileContent> DerefMut for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

impl<'de, Path, FileContent> Deserialize<'de> for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord,
    Path: Deserialize<'de>,
    FileContent: Deserialize<'de>, 
[src]

impl<Path: Eq, FileContent: Eq> Eq for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

impl<Path, FileContent> From<FileSystemTree<Path, FileContent>> for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

impl<Path, FileContent> From<MergeableFileSystemTree<Path, FileContent>> for FileSystemTree<Path, FileContent> where
    Path: Ord
[src]

impl<Path, FileContent> Node for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

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.

impl<Path: PartialEq, FileContent: PartialEq> PartialEq<MergeableFileSystemTree<Path, FileContent>> for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

impl<Path, FileContent> Serialize for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord,
    Path: Serialize,
    FileContent: Serialize
[src]

impl<Path, FileContent> StructuralEq for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

impl<Path, FileContent> StructuralPartialEq for MergeableFileSystemTree<Path, FileContent> where
    Path: Ord
[src]

Auto Trait Implementations

impl<Path, FileContent> RefUnwindSafe for MergeableFileSystemTree<Path, FileContent> where
    FileContent: RefUnwindSafe,
    Path: RefUnwindSafe

impl<Path, FileContent> Send for MergeableFileSystemTree<Path, FileContent> where
    FileContent: Send,
    Path: Send

impl<Path, FileContent> Sync for MergeableFileSystemTree<Path, FileContent> where
    FileContent: Sync,
    Path: Sync

impl<Path, FileContent> Unpin for MergeableFileSystemTree<Path, FileContent> where
    FileContent: Unpin

impl<Path, FileContent> UnwindSafe for MergeableFileSystemTree<Path, FileContent> where
    FileContent: RefUnwindSafe + UnwindSafe,
    Path: RefUnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<X> Pipe for X[src]

impl<X> Pipe for X[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.