Struct tame_index::index::AsyncRemoteSparseIndex
source · pub struct AsyncRemoteSparseIndex {
pub index: SparseIndex,
pub client: AsyncClient,
}Expand description
Allows async access to a remote HTTP sparse registry index
Fields§
§index: SparseIndexThe local index this remote is wrapping
client: AsyncClientThe client used to make requests to the remote index
Implementations§
source§impl AsyncRemoteSparseIndex
impl AsyncRemoteSparseIndex
sourcepub fn new(index: SparseIndex, client: AsyncClient) -> Self
pub fn new(index: SparseIndex, client: AsyncClient) -> Self
Creates a new Self that can access and write local cache entries,
and contact the remote index to retrieve the latest index information
sourcepub async fn krate_async(
&self,
name: KrateName<'_>,
write_cache_entry: bool
) -> Result<Option<IndexKrate>, Error>
pub async fn krate_async( &self, name: KrateName<'_>, write_cache_entry: bool ) -> Result<Option<IndexKrate>, Error>
Async version of RemoteSparseIndex::krate
sourcepub fn cached_krate(
&self,
name: KrateName<'_>
) -> Result<Option<IndexKrate>, Error>
pub fn cached_krate( &self, name: KrateName<'_> ) -> Result<Option<IndexKrate>, Error>
Attempts to read the locally cached crate information
This method does no network I/O unlike Self::krate_async, but does not
guarantee that the cache information is up to date with the latest in
the remote index
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncRemoteSparseIndex
impl Send for AsyncRemoteSparseIndex
impl Sync for AsyncRemoteSparseIndex
impl Unpin for AsyncRemoteSparseIndex
impl !UnwindSafe for AsyncRemoteSparseIndex
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