pub struct MergeCache { /* private fields */ }Expand description
LRU-style cache for merge results, keyed by content hashes.
Avoids re-running expensive semantic merges when the same triple (base, ours, theirs) is seen repeatedly (e.g., in CI rebases or cherry-pick workflows).
§Example
use suture_driver::MergeCache;
let mut cache = MergeCache::new(64);
cache.insert("base", "ours", "theirs", "merged result".to_string());
assert_eq!(cache.get("base", "ours", "theirs"), Some("merged result"));Implementations§
Source§impl MergeCache
impl MergeCache
pub fn new(max_entries: usize) -> Self
pub fn get(&self, base: &str, ours: &str, theirs: &str) -> Option<&str>
pub fn insert(&mut self, base: &str, ours: &str, theirs: &str, result: String)
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn clear(&mut self)
Auto Trait Implementations§
impl Freeze for MergeCache
impl RefUnwindSafe for MergeCache
impl Send for MergeCache
impl Sync for MergeCache
impl Unpin for MergeCache
impl UnsafeUnpin for MergeCache
impl UnwindSafe for MergeCache
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