pub struct Config { /* private fields */ }Expand description
Everything an operation needs: paths plus the manifest.
Implementations§
Source§impl Config
impl Config
Sourcepub fn new(project: Project) -> Self
pub fn new(project: Project) -> Self
File-backed manifest at project.manifest_path() (the CLI’s mode).
Sourcepub fn with_manifest(project: Project, manifest: Manifest) -> Self
pub fn with_manifest(project: Project, manifest: Manifest) -> Self
In-memory manifest; manifest_path() is never read or written.
Sourcepub fn manifest_source(&self) -> &ManifestSource
pub fn manifest_source(&self) -> &ManifestSource
How the manifest is supplied.
Sourcepub fn manifest_is_value(&self) -> bool
pub fn manifest_is_value(&self) -> bool
true for ManifestSource::Value.
Sourcepub fn load_manifest(&self) -> Result<Manifest, PkgError>
pub fn load_manifest(&self) -> Result<Manifest, PkgError>
The manifest this config resolves to: a parse of manifest_path()
for ManifestSource::File, a clone for ManifestSource::Value.
§Errors
File mode only: whatever Manifest::from_path returns.
Sourcepub fn replace_manifest(&self, manifest: Manifest) -> Self
pub fn replace_manifest(&self, manifest: Manifest) -> Self
Same paths, manifest replaced by manifest as a value.
Used by update to re-run install against the manifest it just
rewrote without going through the filesystem.
Trait Implementations§
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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