[−][src]Struct etc::Tree
Here are two file types in Tree
- Dir - no contents, have children
- File - have contents, no children
Fields
path: PathBufFile path
content: Option<Vec<u8>>File content
children: Option<Vec<Tree>>Children files
Implementations
impl Tree[src]
pub fn batch<Fs>(src: Fs) -> Result<Tree, Error> where
Fs: FileSystem, [src]
Fs: FileSystem,
Batch all files into a tree, we can use this to implement some pre build stuffs.
pub fn load(&mut self) -> Result<(), Error>[src]
Load file contents
pub fn map<F>(&mut self, f: F) where
F: FnMut(&mut Tree) + Sized + Copy, [src]
F: FnMut(&mut Tree) + Sized + Copy,
Map the whole tree
pub fn redir<P>(&mut self, path: P) -> Result<(), Error> where
P: AsRef<Path> + Sized, [src]
P: AsRef<Path> + Sized,
Redir tree path, just like cp -r in unix
pub fn refresh(self) -> Result<Tree, Error>[src]
Refresh children
Trait Implementations
impl Debug for Tree[src]
impl Default for Tree[src]
impl Eq for Tree[src]
impl<'_> Into<Vec<PathBuf, Global>> for &'_ Tree[src]
impl<'_> Into<Vec<PathBuf, Global>> for &'_ mut Tree[src]
impl<'_> Into<Vec<Tree, Global>> for &'_ Tree[src]
impl<'_> Into<Vec<Tree, Global>> for &'_ mut Tree[src]
impl PartialEq<Tree> for Tree[src]
impl StructuralEq for Tree[src]
impl StructuralPartialEq for Tree[src]
Auto Trait Implementations
impl RefUnwindSafe for Tree
impl Send for Tree
impl Sync for Tree
impl Unpin for Tree
impl UnwindSafe for Tree
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> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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>,