pub struct LocalVersionStore { /* private fields */ }Expand description
Filesystem-backed local version storage for one folderbase root.
Implementations§
Source§impl LocalVersionStore
impl LocalVersionStore
Sourcepub fn open(root: impl AsRef<Path>) -> Result<Self>
pub fn open(root: impl AsRef<Path>) -> Result<Self>
Open a store rooted at an existing directory.
Storage directories are created lazily by the first accepted write. Reopening a store that already has a transaction directory replays durable pending work and repairs an interrupted final journal append.
pub fn root(&self) -> &Path
pub fn propose_history_transfer( &self, destination: &LocalVersionStore, source_folderbase_id: &str, destination_folderbase_id: &str, object_id: &ObjectId, destination_path: impl AsRef<Path>, ) -> Result<HistoryTransferPlan>
Sourcepub fn capture_file(
&self,
relative_path: impl AsRef<Path>,
) -> Result<CaptureResult>
pub fn capture_file( &self, relative_path: impl AsRef<Path>, ) -> Result<CaptureResult>
Capture the current bytes of a regular file.
Repeated captures at the same tracked path reuse the stable object ID. Capturing unchanged bytes is idempotent and does not append a duplicate version or journal event.
Sourcepub fn record_path_change(
&self,
object_id: &ObjectId,
new_relative_path: impl AsRef<Path>,
) -> Result<LocalObjectRecord>
pub fn record_path_change( &self, object_id: &ObjectId, new_relative_path: impl AsRef<Path>, ) -> Result<LocalObjectRecord>
Rebind an object to a file that has already moved on disk.
This does not move user content. It records the externally completed path change while preserving object and version identity.
Sourcepub fn restore_version(
&self,
version_id: &VersionId,
destination: impl AsRef<Path>,
) -> Result<RestoreResult>
pub fn restore_version( &self, version_id: &VersionId, destination: impl AsRef<Path>, ) -> Result<RestoreResult>
Restore one immutable version to a new relative path.
Existing destinations are never overwritten. The blob is verified before and after installation, and the destination never shares an inode with the immutable blob.
pub fn read_object(&self, object_id: &ObjectId) -> Result<LocalObjectRecord>
pub fn read_version(&self, version_id: &VersionId) -> Result<LocalVersionRecord>
Sourcepub fn journal_events(&self) -> Result<Vec<ObjectJournalEvent>>
pub fn journal_events(&self) -> Result<Vec<ObjectJournalEvent>>
Read and validate every complete journal line.
A final unterminated line is included when it is valid JSON. An invalid unterminated tail is treated as an interrupted append and ignored here; the next write quarantines it before replaying pending transactions.
Source§impl LocalVersionStore
impl LocalVersionStore
Sourcepub fn open_chunk_transfer(
&self,
version_id: &VersionId,
profile: ChunkTransferProfile,
) -> Result<ChunkTransferSource, TransferSourceError>
pub fn open_chunk_transfer( &self, version_id: &VersionId, profile: ChunkTransferProfile, ) -> Result<ChunkTransferSource, TransferSourceError>
Plan a canonical transfer from an exact immutable Core-owned version.
Sourcepub fn reopen_chunk_transfer(
&self,
version_id: &VersionId,
profile: ChunkTransferProfile,
expected_manifest_digest: &str,
) -> Result<ChunkTransferSource, TransferSourceError>
pub fn reopen_chunk_transfer( &self, version_id: &VersionId, profile: ChunkTransferProfile, expected_manifest_digest: &str, ) -> Result<ChunkTransferSource, TransferSourceError>
Deterministically replan a source and bind it to a durable resume checkpoint’s canonical manifest digest.