pub struct CompletionService { /* private fields */ }Expand description
Service for handling Git commit message completion with AI assistance
Implementations§
Source§impl CompletionService
impl CompletionService
Sourcepub fn new(
config: Config,
_repo_path: &Path,
provider_name: &str,
verify: bool,
git_repo: GitRepo,
) -> Result<Self>
pub fn new( config: Config, _repo_path: &Path, provider_name: &str, verify: bool, git_repo: GitRepo, ) -> Result<Self>
Create a new CompletionService instance
§Arguments
config- The configuration for the servicerepo_path- The path to the Git repository (unused but kept for API compatibility)provider_name- The name of the LLM provider to useverify- Whether to verify commitsgit_repo- An existingGitRepoinstance
§Returns
A Result containing the new CompletionService instance or an error
Sourcepub fn is_remote_repository(&self) -> bool
pub fn is_remote_repository(&self) -> bool
Check if the repository is remote
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 complete_message(
&self,
prefix: &str,
context_ratio: f32,
) -> Result<GeneratedMessage>
pub async fn complete_message( &self, prefix: &str, context_ratio: f32, ) -> Result<GeneratedMessage>
Sourcepub fn perform_commit(
&self,
message: &str,
amend: bool,
commit_ref: Option<&str>,
) -> Result<CommitResult>
pub fn perform_commit( &self, message: &str, amend: bool, commit_ref: Option<&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_completion_channel(
&self,
) -> (Sender<Result<GeneratedMessage>>, Receiver<Result<GeneratedMessage>>)
pub fn create_completion_channel( &self, ) -> (Sender<Result<GeneratedMessage>>, Receiver<Result<GeneratedMessage>>)
Create a channel for message completion
Auto Trait Implementations§
impl Freeze for CompletionService
impl !RefUnwindSafe for CompletionService
impl Send for CompletionService
impl Sync for CompletionService
impl Unpin for CompletionService
impl !UnwindSafe for CompletionService
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