Enum tvix_castore::nodes::Node
source · pub enum Node {
Directory {
digest: B3Digest,
size: u64,
},
File {
digest: B3Digest,
size: u64,
executable: bool,
},
Symlink {
target: SymlinkTarget,
},
}
Expand description
A Node is either a [DirectoryNode], [FileNode] or [SymlinkNode]. Nodes themselves don’t have names, what gives them names is either them being inside a Directory, or a root node with its own name attached to it.
Variants§
Directory
A DirectoryNode is a pointer to a Directory, by its Directory::digest.
It also records asize
.
Such a node is either an element in the Directory it itself is contained in,
or a standalone root node.
Fields
size: u64
Number of child elements in the Directory referred to by digest
.
Calculated by summing up the numbers of nodes, and for each directory,
its size field. Can be used for inode allocation.
This field is precisely as verifiable as any other Merkle tree edge.
Resolve digest
, and you can compute it incrementally. Resolve the entire
tree, and you can fully compute it from scratch.
A credulous implementation won’t reject an excessive size, but this is
harmless: you’ll have some ordinals without nodes. Undersizing is obvious
and easy to reject: you won’t have an ordinal for some nodes.
File
A FileNode represents a regular or executable file in a Directory or at the root.
Fields
Symlink
A SymlinkNode represents a symbolic link in a Directory or at the root.
Fields
target: SymlinkTarget
The target of the symlink.
Trait Implementations§
source§impl PartialEq for Node
impl PartialEq for Node
impl Eq for Node
impl StructuralPartialEq for Node
Auto Trait Implementations§
impl !Freeze for Node
impl RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl UnwindSafe for Node
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,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
source§impl<T> FutureExt for T
impl<T> FutureExt for T
source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request