pub struct DiffApply { /* private fields */ }Expand description
Apply a diff to the working directory or index.
§Examples
use ironflow_ops_git::diff::DiffApply;
use ironflow_core::operation::Operation;
let op = DiffApply::new("/path/to/repo", true);
assert_eq!(op.kind(), "git");Implementations§
Source§impl DiffApply
impl DiffApply
Sourcepub fn new(repo_path: impl Into<PathBuf>, to_index: bool) -> Self
pub fn new(repo_path: impl Into<PathBuf>, to_index: bool) -> Self
Create a new diff-apply operation.
If to_index is true, applies to the index. Otherwise, applies to the working directory.
Sourcepub async fn run(
&self,
_ctx: &OperationContext,
) -> Result<DiffApplyOutput, OperationError>
pub async fn run( &self, _ctx: &OperationContext, ) -> Result<DiffApplyOutput, OperationError>
Execute and return a typed result.
Trait Implementations§
Source§impl Operation for DiffApply
impl Operation for DiffApply
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OperationContext,
) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 OperationContext,
) -> Pin<Box<dyn Future<Output = Result<Value, OperationError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute the operation and return the result as JSON. Read more
Source§impl TypedOperation for DiffApply
impl TypedOperation for DiffApply
Source§type Output = DiffApplyOutput
type Output = DiffApplyOutput
The concrete output type that
Operation::execute produces.Auto Trait Implementations§
impl Freeze for DiffApply
impl RefUnwindSafe for DiffApply
impl Send for DiffApply
impl Sync for DiffApply
impl Unpin for DiffApply
impl UnsafeUnpin for DiffApply
impl UnwindSafe for DiffApply
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