pub struct Safety;
Expand description
Safety and backup utilities for destructive operations
Implementations§
Source§impl Safety
impl Safety
Sourcepub fn create_backup_branch(prefix: Option<&str>) -> Result<String>
pub fn create_backup_branch(prefix: Option<&str>) -> Result<String>
Create a backup branch before destructive operations
Sourcepub fn ensure_clean_working_directory() -> Result<()>
pub fn ensure_clean_working_directory() -> Result<()>
Check if working directory is clean before destructive operations
Sourcepub fn confirm_destructive_operation(
operation: &str,
details: &str,
) -> Result<bool>
pub fn confirm_destructive_operation( operation: &str, details: &str, ) -> Result<bool>
Confirm destructive operation with user
Sourcepub fn create_checkpoint(message: Option<&str>) -> Result<String>
pub fn create_checkpoint(message: Option<&str>) -> Result<String>
Create a safety checkpoint (stash) before operation
Sourcepub fn restore_checkpoint() -> Result<()>
pub fn restore_checkpoint() -> Result<()>
Restore from safety checkpoint if operation fails
Sourcepub fn list_backup_branches() -> Result<Vec<String>>
pub fn list_backup_branches() -> Result<Vec<String>>
List recent backup branches created by git-x
Auto Trait Implementations§
impl Freeze for Safety
impl RefUnwindSafe for Safety
impl Send for Safety
impl Sync for Safety
impl Unpin for Safety
impl UnwindSafe for Safety
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