Struct cargo::sources::config::SourceConfigMap
source · pub struct SourceConfigMap<'cfg> {
cfgs: HashMap<String, SourceConfig>,
id2name: HashMap<SourceId, String>,
config: &'cfg Config,
}
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>
pub fn new(config: &'cfg Config) -> CargoResult<SourceConfigMap<'cfg>>
pub fn empty(config: &'cfg Config) -> CargoResult<SourceConfigMap<'cfg>>
pub fn config(&self) -> &'cfg Config
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>>
Get the Source
for a given SourceId
.
fn add(&mut self, name: &str, cfg: SourceConfig) -> CargoResult<()>
fn add_config(&mut self, name: String, def: SourceConfigDef) -> CargoResult<()>
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§
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