Enum tame_index::index::location::IndexUrl
source · pub enum IndexUrl<'iu> {
CratesIoSparse,
CratesIoGit,
NonCratesIo(Cow<'iu, str>),
Local(Cow<'iu, Path>),
}
Expand description
A remote index url
Variants§
CratesIoSparse
The canonical crates.io HTTP sparse index.
CratesIoGit
The canonical crates.io git index.
NonCratesIo(Cow<'iu, str>)
A non-crates.io index.
This variant uses the url to determine the index kind (sparse or git) by
inspecting the url’s scheme. This is because sparse indices are required
to have the sparse+
scheme modifier
Local(Cow<'iu, Path>)
Implementations§
source§impl<'iu> IndexUrl<'iu>
impl<'iu> IndexUrl<'iu>
sourcepub fn crates_io(
config_root: Option<PathBuf>,
cargo_home: Option<&Path>,
cargo_version: Option<&str>
) -> Result<Self, Error>
pub fn crates_io( config_root: Option<PathBuf>, cargo_home: Option<&Path>, cargo_version: Option<&str> ) -> Result<Self, Error>
Gets the IndexUrl
for crates.io, depending on the local environment.
- Determines if the crates.io registry has been replaced
- Determines if the protocol was explicitly configured by the user
- Otherwise, detects the version of cargo (see
crate::utils::cargo_version
), and uses that to determine the appropriate default
Trait Implementations§
Auto Trait Implementations§
impl<'iu> Freeze for IndexUrl<'iu>
impl<'iu> RefUnwindSafe for IndexUrl<'iu>
impl<'iu> Send for IndexUrl<'iu>
impl<'iu> Sync for IndexUrl<'iu>
impl<'iu> Unpin for IndexUrl<'iu>
impl<'iu> UnwindSafe for IndexUrl<'iu>
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