pub struct CommitCreate { /* private fields */ }Expand description
Create a new commit on HEAD.
Stages the current index as a tree, creates a commit with the given message and author, and updates HEAD to point to the new commit.
§Examples
use ironflow_ops_git::commit::CommitCreate;
use ironflow_core::operation::Operation;
let op = CommitCreate::new("/path/to/repo", "Initial commit", "Alice", "alice@example.com");
assert_eq!(op.kind(), "git");Implementations§
Source§impl CommitCreate
impl CommitCreate
Sourcepub fn new(
repo_path: impl Into<PathBuf>,
message: impl Into<String>,
author_name: impl Into<String>,
author_email: impl Into<String>,
) -> Self
pub fn new( repo_path: impl Into<PathBuf>, message: impl Into<String>, author_name: impl Into<String>, author_email: impl Into<String>, ) -> Self
Create a new commit operation.
Sourcepub async fn run(
&self,
_ctx: &OperationContext,
) -> Result<CommitOutput, OperationError>
pub async fn run( &self, _ctx: &OperationContext, ) -> Result<CommitOutput, OperationError>
Execute and return a typed result.
Trait Implementations§
Source§impl Operation for CommitCreate
impl Operation for CommitCreate
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 CommitCreate
impl TypedOperation for CommitCreate
Source§type Output = CommitOutput
type Output = CommitOutput
The concrete output type that
Operation::execute produces.Auto Trait Implementations§
impl Freeze for CommitCreate
impl RefUnwindSafe for CommitCreate
impl Send for CommitCreate
impl Sync for CommitCreate
impl Unpin for CommitCreate
impl UnsafeUnpin for CommitCreate
impl UnwindSafe for CommitCreate
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