pub struct TreeNode {
pub name: String,
pub is_file: bool,
pub size_in_bytes: Option<u64>,
pub children: Vec<Arc<TreeNode>>,
/* private fields */
}Expand description
Represents a node in a tree structure, used to represent directories and files.
Fields§
§name: StringThe name of the node.
is_file: boolIndicates whether the node represents a file (true) or a directory (false).
size_in_bytes: Option<u64>The size of the file in bytes, if it’s a file. None if it’s a directory or if the size is not available.
children: Vec<Arc<TreeNode>>The children of the node, representing subdirectories and files.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for TreeNode
impl<'de> Deserialize<'de> for TreeNode
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
Auto Trait Implementations§
impl Freeze for TreeNode
impl RefUnwindSafe for TreeNode
impl Send for TreeNode
impl Sync for TreeNode
impl Unpin for TreeNode
impl UnwindSafe for TreeNode
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more