pub struct FileTree {
pub entries: BTreeMap<RelativePath, FileEntry>,
}Expand description
A deterministic collection of canonical paths and their entries.
Fields§
§entries: BTreeMap<RelativePath, FileEntry>Entries ordered by canonical relative path.
Implementations§
Source§impl FileTree
impl FileTree
Sourcepub fn contains_file(&self, path: &RelativePath) -> bool
pub fn contains_file(&self, path: &RelativePath) -> bool
Returns whether path names a UTF-8 text file in this tree.
Sourcepub fn file_text(&self, path: &RelativePath) -> Option<&str>
pub fn file_text(&self, path: &RelativePath) -> Option<&str>
Returns the text stored at path, or None when it is not a text file.
Sourcepub fn directories(&self) -> impl Iterator<Item = &RelativePath>
pub fn directories(&self) -> impl Iterator<Item = &RelativePath>
Iterates over canonical directory paths in sorted order.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FileTree
impl<'de> Deserialize<'de> for FileTree
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for FileTree
impl StructuralPartialEq for FileTree
Auto Trait Implementations§
impl Freeze for FileTree
impl RefUnwindSafe for FileTree
impl Send for FileTree
impl Sync for FileTree
impl Unpin for FileTree
impl UnsafeUnpin for FileTree
impl UnwindSafe for FileTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more