Struct rust_assistant::app::RustAssistant
source · 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 toCrateVersionPathspecifying the crate and file path.file_line_range- AFileLineRangespecifying 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,
) -> Result<Option<FileContent>>
pub async fn read_github_repository_file( &self, repo: &Repository, path: &str, ) -> Result<Option<FileContent>>
sourcepub async fn read_github_repository_directory(
&self,
repo: &Repository,
path: &str,
) -> Result<Option<Directory>>
pub async fn read_github_repository_directory( &self, repo: &Repository, path: &str, ) -> Result<Option<Directory>>
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>>
Trait Implementations§
source§impl Clone for RustAssistant
impl Clone for RustAssistant
source§fn clone(&self) -> RustAssistant
fn clone(&self) -> RustAssistant
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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.
Auto Trait Implementations§
impl Freeze for RustAssistant
impl !RefUnwindSafe for RustAssistant
impl Send for RustAssistant
impl Sync for RustAssistant
impl Unpin for RustAssistant
impl !UnwindSafe for RustAssistant
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