pub enum FileTreeNode {
File {
name: String,
size: Option<u64>,
created_at: Option<i64>,
modified_at: Option<i64>,
created_by: Option<String>,
modified_by: Option<String>,
},
Directory {
name: String,
created_at: Option<i64>,
modified_at: Option<i64>,
created_by: Option<String>,
modified_by: Option<String>,
children: Vec<FileTreeNode>,
},
Symlink {
name: String,
target: Option<String>,
created_at: Option<i64>,
modified_at: Option<i64>,
created_by: Option<String>,
modified_by: Option<String>,
},
}Expand description
One node of the filesystem tree — discriminated by type. A
directory carries its children inline; file and symlink are
leaves. Symlinks are the link itself (never followed), so a broken
or looping link renders as a leaf rather than confusing the tree.
Common metadata on every variant: name (basename), created_at
(birth time when the filesystem records one), modified_at
(mtime), and the reserved created_by/modified_by (the
attribution engine fills these later; always None today).
Variants§
File
A regular file.
Fields
created_at: Option<i64>Creation time (unix seconds), when the filesystem records a
birth time. None when unsupported — best-effort display
metadata, never load-bearing.
Directory
A directory — carries its child nodes.
Fields
name: StringBasename of this directory (the watched root is represented by the snapshot’s child list, not by a root node).
modified_at: Option<i64>Last-modified time (unix seconds) — a directory’s mtime tracks entry add/remove.
children: Vec<FileTreeNode>This directory’s entries. Empty for an empty directory — never absent.
Symlink
A symbolic link (the link itself, not its target — never followed).
Implementations§
Source§impl FileTreeNode
impl FileTreeNode
Sourcepub fn children_mut(&mut self) -> Option<&mut Vec<FileTreeNode>>
pub fn children_mut(&mut self) -> Option<&mut Vec<FileTreeNode>>
Mutable access to a directory’s children — None for files and
symlinks.
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for FileTreeNode
impl<'arbitrary> Arbitrary<'arbitrary> for FileTreeNode
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for FileTreeNode
impl Clone for FileTreeNode
Source§fn clone(&self) -> FileTreeNode
fn clone(&self) -> FileTreeNode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FileTreeNode
impl Debug for FileTreeNode
Source§impl<'de> Deserialize<'de> for FileTreeNode
impl<'de> Deserialize<'de> for FileTreeNode
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>,
impl Eq for FileTreeNode
Source§impl JsonSchema for FileTreeNode
impl JsonSchema for FileTreeNode
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for FileTreeNode
impl PartialEq for FileTreeNode
Source§impl Serialize for FileTreeNode
impl Serialize for FileTreeNode
impl StructuralPartialEq for FileTreeNode
Auto Trait Implementations§
impl Freeze for FileTreeNode
impl RefUnwindSafe for FileTreeNode
impl Send for FileTreeNode
impl Sync for FileTreeNode
impl Unpin for FileTreeNode
impl UnsafeUnpin for FileTreeNode
impl UnwindSafe for FileTreeNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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