Struct cargo::sources::registry::RegistryConfig
source · pub struct RegistryConfig {
pub dl: String,
pub api: Option<String>,
pub auth_required: bool,
}
Expand description
The config.json
file stored in the index.
The config file may look like:
{
"dl": "https://example.com/api/{crate}/{version}/download",
"api": "https://example.com/api",
"auth-required": false # unstable feature (RFC 3139)
}
Fields§
§dl: String
Download endpoint for all crates.
The string is a template which will generate the download URL for the
tarball of a specific version of a crate. The substrings {crate}
and
{version}
will be replaced with the crate’s name and version
respectively. The substring {prefix}
will be replaced with the
crate’s prefix directory name, and the substring {lowerprefix}
will
be replaced with the crate’s prefix directory name converted to
lowercase. The substring {sha256-checksum}
will be replaced with the
crate’s sha256 checksum.
For backwards compatibility, if the string does not contain any
markers ({crate}
, {version}
, {prefix}
, or {lowerprefix}
), it
will be extended with /{crate}/{version}/download
to
support registries like crates.io which were created before the
templating setup was created.
For more on the template of the download URL, see Index Configuration.
api: Option<String>
API endpoint for the registry. This is what’s actually hit to perform operations like yanks, owner modifications, publish new crates, etc. If this is None, the registry does not support API commands.
auth_required: bool
Whether all operations require authentication. See RFC 3139.
Implementations§
source§impl RegistryConfig
impl RegistryConfig
sourceconst NAME: &'static str = "config.json"
const NAME: &'static str = "config.json"
File name of RegistryConfig
.
Trait Implementations§
source§impl Clone for RegistryConfig
impl Clone for RegistryConfig
source§fn clone(&self) -> RegistryConfig
fn clone(&self) -> RegistryConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RegistryConfig
impl Debug for RegistryConfig
source§impl<'de> Deserialize<'de> for RegistryConfig
impl<'de> Deserialize<'de> for RegistryConfig
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>,
Auto Trait Implementations§
impl RefUnwindSafe for RegistryConfig
impl Send for RegistryConfig
impl Sync for RegistryConfig
impl Unpin for RegistryConfig
impl UnwindSafe for RegistryConfig
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
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> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes