pub struct SourceConfigMap<'gctx> {
cfgs: HashMap<String, SourceConfig>,
id2name: HashMap<SourceId, String>,
overlays: HashMap<SourceId, SourceId>,
gctx: &'gctx GlobalContext,
}
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.
overlays: HashMap<SourceId, SourceId>
Mapping of sources to local registries that will be overlaid on them.
gctx: &'gctx GlobalContext
Implementations§
Source§impl<'gctx> SourceConfigMap<'gctx>
impl<'gctx> SourceConfigMap<'gctx>
Sourcepub fn new(gctx: &'gctx GlobalContext) -> CargoResult<SourceConfigMap<'gctx>>
pub fn new(gctx: &'gctx GlobalContext) -> CargoResult<SourceConfigMap<'gctx>>
Like SourceConfigMap::empty
but includes sources from source
replacement configurations.
Sourcepub fn new_with_overlays(
gctx: &'gctx GlobalContext,
overlays: impl IntoIterator<Item = (SourceId, SourceId)>,
) -> CargoResult<SourceConfigMap<'gctx>>
pub fn new_with_overlays( gctx: &'gctx GlobalContext, overlays: impl IntoIterator<Item = (SourceId, SourceId)>, ) -> CargoResult<SourceConfigMap<'gctx>>
Like SourceConfigMap::new
but includes sources from source
replacement configurations.
Sourcepub fn empty(gctx: &'gctx GlobalContext) -> CargoResult<SourceConfigMap<'gctx>>
pub fn empty(gctx: &'gctx GlobalContext) -> CargoResult<SourceConfigMap<'gctx>>
Creates the default set of sources that doesn’t take [source]
replacement into account.
Sourcepub fn gctx(&self) -> &'gctx GlobalContext
pub fn gctx(&self) -> &'gctx GlobalContext
Returns the GlobalContext
this source config map is associated with.
Sourcepub fn load(
&self,
id: SourceId,
yanked_whitelist: &HashSet<PackageId>,
) -> CargoResult<Box<dyn Source + 'gctx>>
pub fn load( &self, id: SourceId, yanked_whitelist: &HashSet<PackageId>, ) -> CargoResult<Box<dyn Source + 'gctx>>
Sourcefn load_overlaid(
&self,
id: SourceId,
yanked_whitelist: &HashSet<PackageId>,
) -> CargoResult<Box<dyn Source + 'gctx>>
fn load_overlaid( &self, id: SourceId, yanked_whitelist: &HashSet<PackageId>, ) -> CargoResult<Box<dyn Source + 'gctx>>
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<'gctx> Clone for SourceConfigMap<'gctx>
impl<'gctx> Clone for SourceConfigMap<'gctx>
Source§fn clone(&self) -> SourceConfigMap<'gctx>
fn clone(&self) -> SourceConfigMap<'gctx>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'gctx> Freeze for SourceConfigMap<'gctx>
impl<'gctx> !RefUnwindSafe for SourceConfigMap<'gctx>
impl<'gctx> !Send for SourceConfigMap<'gctx>
impl<'gctx> !Sync for SourceConfigMap<'gctx>
impl<'gctx> Unpin for SourceConfigMap<'gctx>
impl<'gctx> !UnwindSafe for SourceConfigMap<'gctx>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§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>,
§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: 152 bytes