pub struct SemanticTreeNode {
pub format_version: u8,
pub entries: Vec<SemanticTreeEntry>,
}Expand description
A semantic directory node mirroring a source Tree.
Fields§
§format_version: u8§entries: Vec<SemanticTreeEntry>Entries sorted by name (mirrors the source tree’s ordering).
Implementations§
Source§impl SemanticTreeNode
impl SemanticTreeNode
pub const FORMAT_VERSION: u8 = 1
Sourcepub fn new(entries: Vec<SemanticTreeEntry>) -> (Self, ContentHash)
pub fn new(entries: Vec<SemanticTreeEntry>) -> (Self, ContentHash)
Build a node, sorting entries by name and computing the dir digest, which is returned alongside the node.
Sourcepub fn semantic_digest(&self) -> ContentHash
pub fn semantic_digest(&self) -> ContentHash
The node’s reformat-stable digest.
pub fn encode(&self) -> Result<Vec<u8>, SemanticIndexError>
pub fn decode(bytes: &[u8]) -> Result<Self, SemanticIndexError>
pub fn get(&self, name: &str) -> Option<&SemanticTreeEntry>
Trait Implementations§
Source§impl Clone for SemanticTreeNode
impl Clone for SemanticTreeNode
Source§fn clone(&self) -> SemanticTreeNode
fn clone(&self) -> SemanticTreeNode
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 moreSource§impl Debug for SemanticTreeNode
impl Debug for SemanticTreeNode
Source§impl<'de> Deserialize<'de> for SemanticTreeNode
impl<'de> Deserialize<'de> for SemanticTreeNode
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
impl Eq for SemanticTreeNode
Source§impl PartialEq for SemanticTreeNode
impl PartialEq for SemanticTreeNode
Source§impl Serialize for SemanticTreeNode
impl Serialize for SemanticTreeNode
impl StructuralPartialEq for SemanticTreeNode
Auto Trait Implementations§
impl Freeze for SemanticTreeNode
impl RefUnwindSafe for SemanticTreeNode
impl Send for SemanticTreeNode
impl Sync for SemanticTreeNode
impl Unpin for SemanticTreeNode
impl UnsafeUnpin for SemanticTreeNode
impl UnwindSafe for SemanticTreeNode
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