pub struct FolderNode {
pub name: String,
pub parent: Option<Arc<Mutex<FolderNode>>>,
pub children: Vec<Node>,
/* private fields */
}Expand description
Represents a folder in the file system.
Fields§
§name: StringThe name of the folder
parent: Option<Arc<Mutex<FolderNode>>>The parent of the folder
children: Vec<Node>The children of the folder
Implementations§
Source§impl FolderNode
impl FolderNode
Sourcepub fn new(
name: String,
entry: SgaFolderEntry,
parent: Option<Arc<Mutex<FolderNode>>>,
children: Option<Vec<Node>>,
) -> Self
pub fn new( name: String, entry: SgaFolderEntry, parent: Option<Arc<Mutex<FolderNode>>>, children: Option<Vec<Node>>, ) -> Self
Construct a new FolderNode
Sourcepub fn read_files_from_folder<T: Read + BufRead + Seek>(
this: Arc<Mutex<Self>>,
reader: &mut T,
entries: &SgaEntries,
) -> Result<Vec<FileNode>>
pub fn read_files_from_folder<T: Read + BufRead + Seek>( this: Arc<Mutex<Self>>, reader: &mut T, entries: &SgaEntries, ) -> Result<Vec<FileNode>>
Reads all the files from the folder
Kinda annoying, but since we can’t do arbitrary self types in rust, you must pass this instead.
Sourcepub fn read_folders_from_folder<T: Read + BufRead + Seek>(
this: Arc<Mutex<Self>>,
reader: &mut T,
entries: &SgaEntries,
) -> Result<Vec<FolderNode>>
pub fn read_folders_from_folder<T: Read + BufRead + Seek>( this: Arc<Mutex<Self>>, reader: &mut T, entries: &SgaEntries, ) -> Result<Vec<FolderNode>>
Reads all the folders from the specified folder
Kinda annoying, but since we can’t do arbitrary self types in rust, you must pass this instead.
Sourcepub fn folder_from_entry<T: Read + BufRead + Seek>(
reader: &mut T,
entries: &SgaEntries,
folder_entry: &SgaFolderEntry,
parent: Option<Arc<Mutex<FolderNode>>>,
) -> Result<Self>
pub fn folder_from_entry<T: Read + BufRead + Seek>( reader: &mut T, entries: &SgaEntries, folder_entry: &SgaFolderEntry, parent: Option<Arc<Mutex<FolderNode>>>, ) -> Result<Self>
Constructs a folder from an entry
Trait Implementations§
Source§impl Clone for FolderNode
impl Clone for FolderNode
Source§fn clone(&self) -> FolderNode
fn clone(&self) -> FolderNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FolderNode
impl RefUnwindSafe for FolderNode
impl Send for FolderNode
impl Sync for FolderNode
impl Unpin for FolderNode
impl UnsafeUnpin for FolderNode
impl UnwindSafe for FolderNode
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