pub struct SnapshotManager { /* private fields */ }Expand description
Manager for snapshot operations
Implementations§
Source§impl SnapshotManager
impl SnapshotManager
Sourcepub fn open(git_dir: &Path) -> Result<Self, GitError>
pub fn open(git_dir: &Path) -> Result<Self, GitError>
Open a snapshot manager for the repository
Sourcepub fn create(&self, wal_head: Oid, events: &[Event]) -> Result<Oid, GitError>
pub fn create(&self, wal_head: Oid, events: &[Event]) -> Result<Oid, GitError>
Create a new snapshot from events
Sourcepub fn list(&self) -> Result<Vec<SnapshotRef>, GitError>
pub fn list(&self) -> Result<Vec<SnapshotRef>, GitError>
List all snapshots, ordered by timestamp (newest first)
Sourcepub fn should_create(
&self,
events_since_snapshot: usize,
threshold: usize,
) -> bool
pub fn should_create( &self, events_since_snapshot: usize, threshold: usize, ) -> bool
Check if a new snapshot should be created
Auto Trait Implementations§
impl Freeze for SnapshotManager
impl RefUnwindSafe for SnapshotManager
impl Send for SnapshotManager
impl !Sync for SnapshotManager
impl Unpin for SnapshotManager
impl UnwindSafe for SnapshotManager
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