pub struct Operations<'repo> { /* private fields */ }Expand description
Paused merge, rebase, pick, revert and bisect state for one open repository.
Get one with Repository::operation.
§Examples
use grit_lib::repo::{InitOptions, Repository};
let dir = tempfile::tempdir()?;
let (repo, _) = Repository::init(dir.path(), &InitOptions::default())?;
let state = repo.operation().state()?;
assert!(state.is_clean());
assert!(repo.operation().blocking_switch()?.is_none());Implementations§
Source§impl<'repo> Operations<'repo>
impl<'repo> Operations<'repo>
Sourcepub fn repository(&self) -> &'repo Repository
pub fn repository(&self) -> &'repo Repository
Underlying repository.
Sourcepub fn state(&self) -> Result<OperationState>
pub fn state(&self) -> Result<OperationState>
Sourcepub fn in_progress(&self) -> Vec<InProgressOperation>
pub fn in_progress(&self) -> Vec<InProgressOperation>
Just the paused operations, the cheap part of Self::state.
Sourcepub fn blocking_switch(&self) -> Result<Option<InProgressOperation>>
pub fn blocking_switch(&self) -> Result<Option<InProgressOperation>>
Sourcepub fn status_state(&self) -> Result<WtStatusState>
pub fn status_state(&self) -> Result<WtStatusState>
Everything status reports about paused operations: which operation, the branch and
onto commit of a rebase, the picked or reverted commit, and the bisect start.
WtStatusState::detached_from is left unset; the status model
(StatusModel::state) fills it in.
§Errors
Error::Io when a state file cannot be read.
Sourcepub fn clear(&self) -> Result<Vec<InProgressOperation>>
pub fn clear(&self) -> Result<Vec<InProgressOperation>>
Sourcepub fn split_commit_in_progress(&self) -> Result<bool>
pub fn split_commit_in_progress(&self) -> Result<bool>
Whether an interactive rebase stopped to split a commit and the split is not done
yet (HEAD has moved off the commit being edited).
§Errors
Ref store failures resolving HEAD.
Trait Implementations§
Source§impl<'repo> Clone for Operations<'repo>
impl<'repo> Clone for Operations<'repo>
impl<'repo> Copy for Operations<'repo>
Auto Trait Implementations§
impl<'repo> !RefUnwindSafe for Operations<'repo>
impl<'repo> !UnwindSafe for Operations<'repo>
impl<'repo> Forget for Operations<'repo>
impl<'repo> Freeze for Operations<'repo>
impl<'repo> Send for Operations<'repo>
impl<'repo> Sync for Operations<'repo>
impl<'repo> Unpin for Operations<'repo>
impl<'repo> UnsafeUnpin for Operations<'repo>
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