#[non_exhaustive]pub enum ComboIndex {
Git(RemoteGitIndex),
Sparse(RemoteSparseIndex),
Local(LocalRegistry),
}
Available on crate features
__git
and sparse
only.Expand description
A wrapper around either a RemoteGitIndex
or RemoteSparseIndex
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Git(RemoteGitIndex)
A standard git based registry index. No longer the default for crates.io as of 1.70.0
Sparse(RemoteSparseIndex)
An HTTP sparse index
Local(LocalRegistry)
Available on crate feature
local
only.A local registry
Implementations§
Source§impl ComboIndex
impl ComboIndex
Sourcepub fn krate(
&self,
name: KrateName<'_>,
write_cache_entry: bool,
lock: &FileLock,
) -> Result<Option<IndexKrate>, Error>
pub fn krate( &self, name: KrateName<'_>, write_cache_entry: bool, lock: &FileLock, ) -> Result<Option<IndexKrate>, Error>
Retrieves the index metadata for the specified crate name, optionally writing a cache entry for it if there was not already an up to date one
Note no cache entry is written if this is a Local
registry as they do
not use .cache files
Sourcepub fn cached_krate(
&self,
name: KrateName<'_>,
lock: &FileLock,
) -> Result<Option<IndexKrate>, Error>
pub fn cached_krate( &self, name: KrateName<'_>, lock: &FileLock, ) -> Result<Option<IndexKrate>, Error>
Retrieves the cached crate metadata if it exists
Trait Implementations§
Source§impl From<LocalRegistry> for ComboIndex
Available on crate feature local
only.
impl From<LocalRegistry> for ComboIndex
Available on crate feature
local
only.Source§fn from(local: LocalRegistry) -> Self
fn from(local: LocalRegistry) -> Self
Converts to this type from the input type.
Source§impl From<RemoteGitIndex> for ComboIndex
impl From<RemoteGitIndex> for ComboIndex
Source§fn from(index: RemoteGitIndex) -> Self
fn from(index: RemoteGitIndex) -> Self
Converts to this type from the input type.
Source§impl From<RemoteSparseIndex> for ComboIndex
impl From<RemoteSparseIndex> for ComboIndex
Source§fn from(index: RemoteSparseIndex) -> Self
fn from(index: RemoteSparseIndex) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for ComboIndex
impl !RefUnwindSafe for ComboIndex
impl !Send for ComboIndex
impl !Sync for ComboIndex
impl Unpin for ComboIndex
impl !UnwindSafe for ComboIndex
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