pub struct RustAssistant { /* private fields */ }
Expand description
The RustAssistant
struct, providing functionalities to interact with crates and their contents.
This struct encapsulates methods for downloading crates, reading their content, and performing searches within them.
Implementations§
Source§impl RustAssistant
impl RustAssistant
Sourcepub async fn get_crate(&self, crate_version: &CrateVersion) -> Result<Crate>
pub async fn get_crate(&self, crate_version: &CrateVersion) -> Result<Crate>
Sourcepub async fn get_file_content(
&self,
crate_version_path: &CrateVersionPath,
file_line_range: FileLineRange,
) -> Result<Option<FileContent>>
pub async fn get_file_content( &self, crate_version_path: &CrateVersionPath, file_line_range: FileLineRange, ) -> Result<Option<FileContent>>
Retrieves the content of a file within a specified crate and range.
§Arguments
crate_version_path
- A reference toCrateVersionPath
specifying the crate and file path.file_line_range
- AFileLineRange
specifying the range of lines to retrieve.
§Returns
A Result
wrapping an Option<CrateFileContent>
, or an error if the operation fails.
Sourcepub async fn read_directory(
&self,
crate_version_path: CrateVersionPath,
) -> Result<Option<Directory>>
pub async fn read_directory( &self, crate_version_path: CrateVersionPath, ) -> Result<Option<Directory>>
Sourcepub async fn search_item(
&self,
crate_version: &CrateVersion,
query: impl Into<ItemQuery>,
) -> Result<Vec<Item>>
pub async fn search_item( &self, crate_version: &CrateVersion, query: impl Into<ItemQuery>, ) -> Result<Vec<Item>>
Sourcepub async fn search_line(
&self,
crate_version: &CrateVersion,
query: impl Into<LineQuery>,
) -> Result<Vec<Line>>
pub async fn search_line( &self, crate_version: &CrateVersion, query: impl Into<LineQuery>, ) -> Result<Vec<Line>>
Sourcepub async fn read_github_repository_file(
&self,
repo: &Repository,
path: &str,
branch: impl Into<Option<&str>>,
) -> Result<Option<FileContent>>
pub async fn read_github_repository_file( &self, repo: &Repository, path: &str, branch: impl Into<Option<&str>>, ) -> Result<Option<FileContent>>
Reads the content of a file within a specified GitHub repository.
§Arguments
repo
- A reference toRepository
specifying the GitHub repository.path
- A&str
specifying the file path.branch
- An optional&str
specifying the branch name.
§Returns
A Result
wrapping a FileContent
, or an error if the operation fails.
Sourcepub async fn read_github_repository_directory(
&self,
repo: &Repository,
path: &str,
branch: impl Into<Option<&str>>,
) -> Result<Option<Directory>>
pub async fn read_github_repository_directory( &self, repo: &Repository, path: &str, branch: impl Into<Option<&str>>, ) -> Result<Option<Directory>>
Reads the content of a directory within a specified GitHub repository.
§Arguments
repo
- A reference toRepository
specifying the GitHub repository.path
- A&str
specifying the directory path.branch
- An optional&str
specifying the branch name.
§Returns
A Result
wrapping a Directory
, or an error if the operation fails.
Sourcepub async fn search_github_repository_for_issues(
&self,
repo: &Repository,
query: &str,
) -> Result<Vec<Issue>>
pub async fn search_github_repository_for_issues( &self, repo: &Repository, query: &str, ) -> Result<Vec<Issue>>
Sourcepub async fn get_github_repository_issue_timeline(
&self,
repo: &Repository,
issue_number: u64,
) -> Result<Vec<IssueEvent>>
pub async fn get_github_repository_issue_timeline( &self, repo: &Repository, issue_number: u64, ) -> Result<Vec<IssueEvent>>
Sourcepub async fn get_github_repository_branches(
&self,
repo: &Repository,
) -> Result<Vec<String>>
pub async fn get_github_repository_branches( &self, repo: &Repository, ) -> Result<Vec<String>>
Retrieves the branches of a specified GitHub repository.
Trait Implementations§
Source§impl Clone for RustAssistant
impl Clone for RustAssistant
Source§fn clone(&self) -> RustAssistant
fn clone(&self) -> RustAssistant
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl From<(CrateDownloader, CrateCache, GithubClient)> for RustAssistant
impl From<(CrateDownloader, CrateCache, GithubClient)> for RustAssistant
Source§fn from(
(downloader, cache, github): (CrateDownloader, CrateCache, GithubClient),
) -> Self
fn from( (downloader, cache, github): (CrateDownloader, CrateCache, GithubClient), ) -> Self
Creates a new RustAssistant
instance from a tuple of dependencies.