pub struct InMemorySnapshotStore { /* private fields */ }Expand description
In-memory SnapshotStore backed by lru. Per-path history is a short
ring of full-file versions (oldest dropped first); per-session path tracking
is LRU-bounded so cold paths age out automatically.
Recording byte-identical content again refreshes recency and reuses the existing tag (read fusion); recording new content unshifts a fresh version onto the front of the path history.
Implementations§
Source§impl InMemorySnapshotStore
impl InMemorySnapshotStore
Sourcepub fn with_options(opts: InMemorySnapshotStoreOptions) -> Self
pub fn with_options(opts: InMemorySnapshotStoreOptions) -> Self
Build a store with custom limits.
Trait Implementations§
Source§impl Debug for InMemorySnapshotStore
impl Debug for InMemorySnapshotStore
Source§impl Default for InMemorySnapshotStore
impl Default for InMemorySnapshotStore
Source§impl SnapshotStore for InMemorySnapshotStore
impl SnapshotStore for InMemorySnapshotStore
Source§fn head(&self, path: &str) -> Option<Snapshot>
fn head(&self, path: &str) -> Option<Snapshot>
Most-recently recorded version for
path, or None if none.Source§fn by_hash(&self, path: &str, hash: &str) -> Option<Snapshot>
fn by_hash(&self, path: &str, hash: &str) -> Option<Snapshot>
Recorded version for
path whose tag equals hash, or None.Source§fn record(
&self,
path: &str,
full_text: &str,
seen_lines: Option<&[u32]>,
) -> String
fn record( &self, path: &str, full_text: &str, seen_lines: Option<&[u32]>, ) -> String
Record the full normalized text of
path and return its content tag.
seen_lines (optional) are the 1-indexed lines the producer displayed;
they merge into Snapshot::seen_lines across reads of identical text.Source§fn record_seen_lines(&self, path: &str, hash: &str, lines: &[u32])
fn record_seen_lines(&self, path: &str, hash: &str, lines: &[u32])
Merge
lines into the Snapshot::seen_lines of the version whose tag
equals hash. No-op when no such version is retained.Source§fn invalidate(&self, path: &str)
fn invalidate(&self, path: &str)
Drop the version history for a single path.
Auto Trait Implementations§
impl !Freeze for InMemorySnapshotStore
impl !RefUnwindSafe for InMemorySnapshotStore
impl Send for InMemorySnapshotStore
impl Sync for InMemorySnapshotStore
impl Unpin for InMemorySnapshotStore
impl UnsafeUnpin for InMemorySnapshotStore
impl UnwindSafe for InMemorySnapshotStore
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