pub struct CommitTimer { /* private fields */ }Expand description
A timer that signals when commits are due.
This runs a background thread that sets a flag when the commit interval elapses.
The actual commit must be performed by calling try_commit() with the repository.
Implementations§
Source§impl CommitTimer
impl CommitTimer
Sourcepub fn start(config: CommitConfig) -> Self
pub fn start(config: CommitConfig) -> Self
Start a new commit timer
Sourcepub fn try_commit(
&self,
staging: &Staging,
repo: &Repository,
) -> FsResult<Option<String>>
pub fn try_commit( &self, staging: &Staging, repo: &Repository, ) -> FsResult<Option<String>>
Check if a commit is due and try to perform it
Sourcepub fn force_commit(&self)
pub fn force_commit(&self)
Request an immediate forced commit
Sourcepub fn is_commit_due(&self) -> bool
pub fn is_commit_due(&self) -> bool
Check if a commit is currently due
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the timer is still running
Source§impl CommitTimer
impl CommitTimer
Sourcepub fn start_legacy(
_staging: Staging,
_repo: Arc<Repository>,
config: CommitConfig,
) -> FsResult<Self>
pub fn start_legacy( _staging: Staging, _repo: Arc<Repository>, config: CommitConfig, ) -> FsResult<Self>
Start a new commit worker (delegates to CommitTimer)
Note: The repo parameter is ignored as commits happen synchronously.
Use try_commit() or commit_now() to perform actual commits.
Trait Implementations§
Source§impl Drop for CommitTimer
impl Drop for CommitTimer
Auto Trait Implementations§
impl !RefUnwindSafe for CommitTimer
impl !UnwindSafe for CommitTimer
impl Freeze for CommitTimer
impl Send for CommitTimer
impl Sync for CommitTimer
impl Unpin for CommitTimer
impl UnsafeUnpin for CommitTimer
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