pub struct HttpRepository { /* private fields */ }Expand description
HTTP repository client
Implementations§
Source§impl HttpRepository
impl HttpRepository
Sourcepub fn new(
repo: Repository,
credentials: Option<ResolvedCredentials>,
) -> Result<Self>
pub fn new( repo: Repository, credentials: Option<ResolvedCredentials>, ) -> Result<Self>
Create a new HTTP repository client
Sourcepub fn public(repo: Repository) -> Result<Self>
pub fn public(repo: Repository) -> Result<Self>
Create for a public repository (no auth)
Sourcepub async fn fetch_index(&mut self) -> Result<&RepositoryIndex>
pub async fn fetch_index(&mut self) -> Result<&RepositoryIndex>
Fetch or refresh the repository index
Sourcepub fn index(&self) -> Option<&RepositoryIndex>
pub fn index(&self) -> Option<&RepositoryIndex>
Get the cached index without fetching
Sourcepub async fn search(&mut self, query: &str) -> Result<Vec<&PackEntry>>
pub async fn search(&mut self, query: &str) -> Result<Vec<&PackEntry>>
Search packs in the repository
Sourcepub async fn get_latest(&mut self, name: &str) -> Result<PackEntry>
pub async fn get_latest(&mut self, name: &str) -> Result<PackEntry>
Get the latest version of a pack
Sourcepub async fn get_version(
&mut self,
name: &str,
version: &str,
) -> Result<PackEntry>
pub async fn get_version( &mut self, name: &str, version: &str, ) -> Result<PackEntry>
Get a specific version of a pack
Sourcepub async fn find_best_match(
&mut self,
name: &str,
constraint: &str,
) -> Result<PackEntry>
pub async fn find_best_match( &mut self, name: &str, constraint: &str, ) -> Result<PackEntry>
Find best matching version for a constraint
Auto Trait Implementations§
impl Freeze for HttpRepository
impl !RefUnwindSafe for HttpRepository
impl Send for HttpRepository
impl Sync for HttpRepository
impl Unpin for HttpRepository
impl !UnwindSafe for HttpRepository
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