pub struct ShadowStorage;Implementations§
Source§impl ShadowStorage
impl ShadowStorage
Sourcepub fn checkpoint(
repo_path: &Path,
session_id: &str,
files: &[FileSnapshot],
removals: &[FileRemoval],
meta: &ShadowMeta,
) -> Result<usize>
pub fn checkpoint( repo_path: &Path, session_id: &str, files: &[FileSnapshot], removals: &[FileRemoval], meta: &ShadowMeta, ) -> Result<usize>
Create or add a checkpoint on a shadow branch.
If the shadow ref doesn’t exist yet, creates the initial checkpoint (checkpoint 0) with an empty-tree base and no parent commit. Otherwise appends an incremental checkpoint on top of the existing tip.
Returns the checkpoint number.
Sourcepub fn read_checkpoint(
repo_path: &Path,
session_id: &str,
checkpoint: Option<usize>,
) -> Result<Vec<FileSnapshot>>
pub fn read_checkpoint( repo_path: &Path, session_id: &str, checkpoint: Option<usize>, ) -> Result<Vec<FileSnapshot>>
Read file snapshots from a checkpoint. None = latest.
Sourcepub fn list_checkpoints(
repo_path: &Path,
session_id: &str,
) -> Result<Vec<CheckpointInfo>>
pub fn list_checkpoints( repo_path: &Path, session_id: &str, ) -> Result<Vec<CheckpointInfo>>
List all checkpoints for a session.
Sourcepub fn read_meta(
repo_path: &Path,
session_id: &str,
) -> Result<Option<ShadowMeta>>
pub fn read_meta( repo_path: &Path, session_id: &str, ) -> Result<Option<ShadowMeta>>
Read the shadow meta from the latest checkpoint.
Sourcepub fn condense(
repo_path: &Path,
session_id: &str,
final_hail: &[u8],
final_meta: &[u8],
) -> Result<String>
pub fn condense( repo_path: &Path, session_id: &str, final_hail: &[u8], final_meta: &[u8], ) -> Result<String>
Condense: archive the final HAIL to the sessions branch, then delete the shadow.
Auto Trait Implementations§
impl Freeze for ShadowStorage
impl RefUnwindSafe for ShadowStorage
impl Send for ShadowStorage
impl Sync for ShadowStorage
impl Unpin for ShadowStorage
impl UnwindSafe for ShadowStorage
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