pub struct IrisCommitService { /* private fields */ }
Expand description
Service for handling Git commit operations with AI assistance
Implementations§
Source§impl IrisCommitService
impl IrisCommitService
Sourcepub fn new(
config: Config,
repo_path: &Path,
provider_name: &str,
use_gitmoji: bool,
verify: bool,
) -> Result<Self>
pub fn new( config: Config, repo_path: &Path, provider_name: &str, use_gitmoji: bool, verify: bool, ) -> Result<Self>
Create a new IrisCommitService
instance
§Arguments
config
- The configuration for the servicerepo_path
- The path to the Git repositoryprovider_name
- The name of the LLM provider to useuse_gitmoji
- Whether to use Gitmoji in commit messagesverify
- Whether to verify commits
§Returns
A Result containing the new IrisCommitService
instance or an error
Sourcepub fn check_environment(&self) -> Result<()>
pub fn check_environment(&self) -> Result<()>
Check the environment for necessary prerequisites
Sourcepub async fn get_git_info(&self) -> Result<CommitContext>
pub async fn get_git_info(&self) -> Result<CommitContext>
Get Git information for the current repository
Sourcepub async fn generate_message(
&self,
preset: &str,
instructions: &str,
) -> Result<GeneratedMessage>
pub async fn generate_message( &self, preset: &str, instructions: &str, ) -> Result<GeneratedMessage>
Sourcepub async fn generate_review(
&self,
preset: &str,
instructions: &str,
) -> Result<GeneratedReview>
pub async fn generate_review( &self, preset: &str, instructions: &str, ) -> Result<GeneratedReview>
Sourcepub fn perform_commit(&self, message: &str) -> Result<CommitResult>
pub fn perform_commit(&self, message: &str) -> Result<CommitResult>
Sourcepub fn pre_commit(&self) -> Result<()>
pub fn pre_commit(&self) -> Result<()>
Execute the pre-commit hook if verification is enabled
Sourcepub fn create_message_channel(
&self,
) -> (Sender<Result<GeneratedMessage>>, Receiver<Result<GeneratedMessage>>)
pub fn create_message_channel( &self, ) -> (Sender<Result<GeneratedMessage>>, Receiver<Result<GeneratedMessage>>)
Create a channel for message generation
Auto Trait Implementations§
impl Freeze for IrisCommitService
impl !RefUnwindSafe for IrisCommitService
impl Send for IrisCommitService
impl Sync for IrisCommitService
impl Unpin for IrisCommitService
impl !UnwindSafe for IrisCommitService
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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