Struct cargo_fetcher::cargo::Registry
source · pub struct Registry {
pub index: Url,
pub protocol: RegistryProtocol,
/* private fields */
}
Fields§
§index: Url
§protocol: RegistryProtocol
Implementations§
source§impl Registry
impl Registry
pub fn new(index: impl AsRef<str>, dl: Option<String>) -> Result<Self>
pub fn crates_io(protocol: RegistryProtocol) -> Self
sourcepub fn download_url(&self, krate: &Krate) -> String
pub fn download_url(&self, krate: &Krate) -> String
Gets the download url for the crate
See https://doc.rust-lang.org/cargo/reference/registries.html#index-format for more info
pub fn short_name(&self) -> &str
pub fn cache_dir(&self, root: &Path) -> PathBuf
pub fn src_dir(&self, root: &Path) -> PathBuf
pub fn sync_dirs(&self, root: &Path) -> (PathBuf, PathBuf)
pub fn is_crates_io(&self) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Registry
impl<'de> Deserialize<'de> for Registry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for Registry
impl Ord for Registry
source§impl PartialEq<Registry> for Krate
impl PartialEq<Registry> for Krate
source§impl PartialOrd<Registry> for Registry
impl PartialOrd<Registry> for Registry
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for Registry
impl StructuralEq for Registry
Auto Trait Implementations§
impl RefUnwindSafe for Registry
impl Send for Registry
impl Sync for Registry
impl Unpin for Registry
impl UnwindSafe for Registry
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.