Struct cargo::sources::config::SourceConfigMap
source · pub struct SourceConfigMap<'cfg> {
cfgs: HashMap<String, SourceConfig>,
id2name: HashMap<SourceId, String>,
config: &'cfg Config,
}
Expand description
Represents the entire [source]
replacement table in Cargo configuration.
Fields§
§cfgs: HashMap<String, SourceConfig>
Mapping of source name to the toml configuration.
id2name: HashMap<SourceId, String>
Mapping of SourceId
to the source name.
config: &'cfg Config
Implementations§
source§impl<'cfg> SourceConfigMap<'cfg>
impl<'cfg> SourceConfigMap<'cfg>
sourcepub fn new(config: &'cfg Config) -> CargoResult<SourceConfigMap<'cfg>>
pub fn new(config: &'cfg Config) -> CargoResult<SourceConfigMap<'cfg>>
Like SourceConfigMap::empty
but includes sources from source
replacement configurations.
sourcepub fn empty(config: &'cfg Config) -> CargoResult<SourceConfigMap<'cfg>>
pub fn empty(config: &'cfg Config) -> CargoResult<SourceConfigMap<'cfg>>
Creates the default set of sources that doesn’t take [source]
replacement into account.
sourcepub fn config(&self) -> &'cfg Config
pub fn config(&self) -> &'cfg Config
Returns the Config
this source config map is associated with.
sourcepub fn load(
&self,
id: SourceId,
yanked_whitelist: &HashSet<PackageId>
) -> CargoResult<Box<dyn Source + 'cfg>>
pub fn load( &self, id: SourceId, yanked_whitelist: &HashSet<PackageId> ) -> CargoResult<Box<dyn Source + 'cfg>>
sourcefn add(&mut self, name: &str, cfg: SourceConfig) -> CargoResult<()>
fn add(&mut self, name: &str, cfg: SourceConfig) -> CargoResult<()>
Adds a source config with an associated name.
sourcefn add_config(&mut self, name: String, def: SourceConfigDef) -> CargoResult<()>
fn add_config(&mut self, name: String, def: SourceConfigDef) -> CargoResult<()>
Adds a source config from TOML definition.
Trait Implementations§
source§impl<'cfg> Clone for SourceConfigMap<'cfg>
impl<'cfg> Clone for SourceConfigMap<'cfg>
source§fn clone(&self) -> SourceConfigMap<'cfg>
fn clone(&self) -> SourceConfigMap<'cfg>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'cfg> !RefUnwindSafe for SourceConfigMap<'cfg>
impl<'cfg> !Send for SourceConfigMap<'cfg>
impl<'cfg> !Sync for SourceConfigMap<'cfg>
impl<'cfg> Unpin for SourceConfigMap<'cfg>
impl<'cfg> !UnwindSafe for SourceConfigMap<'cfg>
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> 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>
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: 104 bytes