pub struct MerkleTreeManager { /* private fields */ }Expand description
Manages Merkle trees for efficient change detection in code repositories.
Uses file content hashes to build a tree representation of the repository state, enabling fast detection of file changes without parsing.
Implementations§
Source§impl MerkleTreeManager
impl MerkleTreeManager
Sourcepub fn new(exclusion_filter: ExclusionFilter) -> Self
pub fn new(exclusion_filter: ExclusionFilter) -> Self
Create a new MerkleTreeManager with the given exclusion filter.
Sourcepub fn build_merkle_tree(&self, repo_path: &Path) -> Result<MerkleTree>
pub fn build_merkle_tree(&self, repo_path: &Path) -> Result<MerkleTree>
Sourcepub fn detect_changes(
&self,
old_tree: &MerkleTree,
new_tree: &MerkleTree,
) -> ChangeSet
pub fn detect_changes( &self, old_tree: &MerkleTree, new_tree: &MerkleTree, ) -> ChangeSet
Sourcepub fn get_tree_stats(&self, tree: &MerkleTree) -> TreeStats
pub fn get_tree_stats(&self, tree: &MerkleTree) -> TreeStats
Get statistics about a Merkle tree.
Sourcepub fn save_tree_to_file(
&self,
tree: &MerkleTree,
file_path: &Path,
) -> Result<()>
pub fn save_tree_to_file( &self, tree: &MerkleTree, file_path: &Path, ) -> Result<()>
Save a Merkle tree to a JSON file.
Sourcepub fn load_tree_from_file(&self, file_path: &Path) -> Result<MerkleTree>
pub fn load_tree_from_file(&self, file_path: &Path) -> Result<MerkleTree>
Load a Merkle tree from a JSON file.
Trait Implementations§
Source§impl Clone for MerkleTreeManager
impl Clone for MerkleTreeManager
Source§fn clone(&self) -> MerkleTreeManager
fn clone(&self) -> MerkleTreeManager
Returns a duplicate of the value. Read more
1.0.0 · 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 MerkleTreeManager
impl Debug for MerkleTreeManager
Auto Trait Implementations§
impl Freeze for MerkleTreeManager
impl RefUnwindSafe for MerkleTreeManager
impl Send for MerkleTreeManager
impl Sync for MerkleTreeManager
impl Unpin for MerkleTreeManager
impl UnwindSafe for MerkleTreeManager
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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