pub(crate) struct FetchMetadata {
command: MetadataCommand,
manifest_path: ManifestPath,
lockfile_copy: Option<LockfileCopy>,
kind: &'static str,
no_deps: bool,
no_deps_result: Result<Metadata>,
other_options: Vec<String>,
}Fields§
§command: MetadataCommand§manifest_path: ManifestPath§lockfile_copy: Option<LockfileCopy>§kind: &'static str§no_deps: bool§no_deps_result: Result<Metadata>§other_options: Vec<String>Implementations§
Source§impl FetchMetadata
impl FetchMetadata
Sourcepub(crate) fn new(
cargo_toml: &ManifestPath,
current_dir: &AbsPath,
config: &CargoMetadataConfig,
sysroot: &Sysroot,
no_deps: bool,
) -> Self
pub(crate) fn new( cargo_toml: &ManifestPath, current_dir: &AbsPath, config: &CargoMetadataConfig, sysroot: &Sysroot, no_deps: bool, ) -> Self
Builds a command to fetch metadata for the given cargo_toml manifest.
Performs a lightweight pre-fetch using the --no-deps option,
available via FetchMetadata::no_deps_metadata, to gather basic
information such as the target-dir.
The provided sysroot is used to set the RUSTUP_TOOLCHAIN
environment variable when invoking Cargo, ensuring that the
rustup proxy selects the correct toolchain.
Sourcepub(crate) fn exec(
self,
locked: bool,
progress: &dyn Fn(String),
) -> Result<(Metadata, Option<Error>)>
pub(crate) fn exec( self, locked: bool, progress: &dyn Fn(String), ) -> Result<(Metadata, Option<Error>)>
Executes the metadata-fetching command.
A successful result may still contain a metadata error if the full fetch failed,
but the fallback --no-deps pre-fetch succeeded during command construction.
Auto Trait Implementations§
impl Freeze for FetchMetadata
impl RefUnwindSafe for FetchMetadata
impl Send for FetchMetadata
impl Sync for FetchMetadata
impl Unpin for FetchMetadata
impl UnsafeUnpin for FetchMetadata
impl UnwindSafe for FetchMetadata
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<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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more