pub struct WorktreeVersionedKvStore<const N: usize> { /* private fields */ }
Expand description
A VersionedKvStore that works within a worktree
Implementations§
Source§impl<const N: usize> WorktreeVersionedKvStore<N>
impl<const N: usize> WorktreeVersionedKvStore<N>
Sourcepub fn from_worktree(
worktree_info: WorktreeInfo,
manager: Arc<Mutex<WorktreeManager>>,
) -> Result<Self, GitKvError>
pub fn from_worktree( worktree_info: WorktreeInfo, manager: Arc<Mutex<WorktreeManager>>, ) -> Result<Self, GitKvError>
Create a new WorktreeVersionedKvStore from an existing worktree
Sourcepub fn worktree_id(&self) -> &str
pub fn worktree_id(&self) -> &str
Get the worktree ID
Sourcepub fn current_branch(&self) -> &str
pub fn current_branch(&self) -> &str
Get the current branch
Sourcepub fn unlock(&self) -> Result<(), GitKvError>
pub fn unlock(&self) -> Result<(), GitKvError>
Unlock this worktree
Sourcepub fn store(&self) -> &GitVersionedKvStore<N>
pub fn store(&self) -> &GitVersionedKvStore<N>
Get a reference to the underlying store
Sourcepub fn store_mut(&mut self) -> &mut GitVersionedKvStore<N>
pub fn store_mut(&mut self) -> &mut GitVersionedKvStore<N>
Get a mutable reference to the underlying store
Sourcepub fn merge_to_main(
&mut self,
main_store: &mut GitVersionedKvStore<N>,
commit_message: &str,
) -> Result<String, GitKvError>
pub fn merge_to_main( &mut self, main_store: &mut GitVersionedKvStore<N>, commit_message: &str, ) -> Result<String, GitKvError>
Merge this worktree’s branch back to the main branch This is a convenience method that requires a target store representing the main repository
Sourcepub fn merge_to_branch(
&mut self,
target_store: &mut GitVersionedKvStore<N>,
target_branch: &str,
commit_message: &str,
) -> Result<String, GitKvError>
pub fn merge_to_branch( &mut self, target_store: &mut GitVersionedKvStore<N>, target_branch: &str, commit_message: &str, ) -> Result<String, GitKvError>
Merge this worktree’s branch to another target branch
Sourcepub fn merge_to_branch_with_resolver<R: ConflictResolver>(
&mut self,
target_store: &mut GitVersionedKvStore<N>,
target_branch: &str,
resolver: &R,
commit_message: &str,
) -> Result<String, GitKvError>
pub fn merge_to_branch_with_resolver<R: ConflictResolver>( &mut self, target_store: &mut GitVersionedKvStore<N>, target_branch: &str, resolver: &R, commit_message: &str, ) -> Result<String, GitKvError>
Merge this worktree’s branch with custom conflict resolution
Sourcepub fn try_merge_to_main(
&mut self,
main_store: &mut GitVersionedKvStore<N>,
) -> Result<Vec<MergeConflict>, GitKvError>
pub fn try_merge_to_main( &mut self, main_store: &mut GitVersionedKvStore<N>, ) -> Result<Vec<MergeConflict>, GitKvError>
Try to merge to main with conflict detection (doesn’t apply changes if conflicts exist)
Auto Trait Implementations§
impl<const N: usize> !Freeze for WorktreeVersionedKvStore<N>
impl<const N: usize> !RefUnwindSafe for WorktreeVersionedKvStore<N>
impl<const N: usize> Send for WorktreeVersionedKvStore<N>
impl<const N: usize> !Sync for WorktreeVersionedKvStore<N>
impl<const N: usize> Unpin for WorktreeVersionedKvStore<N>
impl<const N: usize> !UnwindSafe for WorktreeVersionedKvStore<N>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more