MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / ChangeStore

Class ChangeStore

atomic-repository/src/changestore/mod.rs:115–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113pub(crate) use cache::LruCache;
114
115pub struct ChangeStore {
116 /// Path to the changes directory (`.atomic/changes/`)
117 pub(crate) changes_dir: PathBuf,
118
119 /// LRU cache of recently accessed changes.
120 ///
121 /// We use `RwLock` for thread-safe interior mutability, allowing
122 /// concurrent read access while ensuring exclusive write access.
123 pub(crate) cache: RwLock<LruCache<Hash, Change>>,
124
125 /// Parsed, hash-verified changes keyed by hash. Change files are
126 /// content-addressed and write-once, so a verified parse is immutable
127 /// for this handle's lifetime; re-parsing an 11 MB baseline per rendered
128 /// file is the dominant cost of span rendering.
129 pub(crate) verified_cache: RwLock<LruCache<Hash, VerifiedChange>>,
130
131 /// Content spans held without their change files — a remote sandbox's
132 /// cache has the bytes of the vertices it was sent, never whole changes.
133 /// Consulted before the change files.
134 pub(crate) spans: RwLock<SpanOverlay>,
135}
136
137/// Content bytes by `(change, start)`, each covering `start..end`.
138#[derive(Debug, Default)]

Callers 4

classifyMethod · 0.50
require_dependencyFunction · 0.50
record_with_lifecycleMethod · 0.50
assemble_and_hashMethod · 0.50

Implementers 1

view_entries_span_context_tests.rsatomic-repository/src/repository/tests

Calls

no outgoing calls

Tested by

no test coverage detected