Skip to main content

LocalVersionStore

Struct LocalVersionStore 

Source
pub struct LocalVersionStore { /* private fields */ }
Expand description

Filesystem-backed local version storage for one folderbase root.

Implementations§

Source§

impl LocalVersionStore

Source

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.

Source

pub fn root(&self) -> &Path

Source

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>

Source

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.

Source

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.

Source

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.

Source

pub fn read_object(&self, object_id: &ObjectId) -> Result<LocalObjectRecord>

Source

pub fn read_version(&self, version_id: &VersionId) -> Result<LocalVersionRecord>

Source

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

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for LocalVersionStore

Source§

fn clone(&self) -> LocalVersionStore

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LocalVersionStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.