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.