MCPcopy Create free account
hub / github.com/carsonpo/haystackdb / new

Method new

src/structures/wal.rs:178–193  ·  view source on GitHub ↗
(path: PathBuf, namespace_id: String)

Source from the content-addressed store, hash-verified

176
177impl WAL {
178 pub fn new(path: PathBuf, namespace_id: String) -> io::Result<Self> {
179 let commit_list_path = path.clone().join("commit_list.bin");
180 let commit_list = Tree::<u64, CommitListItem>::new(commit_list_path)?;
181 let timestamps_path = path.clone().join("timestamps.bin");
182 let timestamps = Tree::<u64, Vec<u64>>::new(timestamps_path)?;
183 let commit_finish_path = path.clone().join("commit_finish.bin");
184 let commit_finish = Tree::<u64, bool>::new(commit_finish_path)?;
185
186 Ok(WAL {
187 commit_list,
188 path,
189 namespace_id,
190 timestamps,
191 commit_finish,
192 })
193 }
194
195 pub fn add_to_commit_list(
196 &mut self,

Callers

nothing calls this directly

Calls 1

cloneMethod · 0.80

Tested by

no test coverage detected