pub struct CargoManifest(/* private fields */);Expand description
A Cargo.toml manifest.
Implementations§
Source§impl CargoManifest
impl CargoManifest
Sourcepub fn new(name: &str, version: Version) -> Self
pub fn new(name: &str, version: Version) -> Self
Creates a Cargo manifest with the given package name and version.
Sourcepub fn from_disk(path: &Path) -> Result<Self, CargoManifestError>
pub fn from_disk(path: &Path) -> Result<Self, CargoManifestError>
Reads and parses an existing Cargo manifest from disk.
Sourcepub fn parse(s: &str) -> Result<Self, CargoManifestError>
pub fn parse(s: &str) -> Result<Self, CargoManifestError>
Parses a Cargo manifest from a TOML string.
Sourcepub fn package(&self) -> Option<Package<'_>>
pub fn package(&self) -> Option<Package<'_>>
Returns a view of the package section, or None if this is
a workspace or malformed manifest.
Sourcepub fn apply(self, diff: CargoManifestDiff) -> Self
pub fn apply(self, diff: CargoManifestDiff) -> Self
Applies a diff of changes to the manifest.
Trait Implementations§
Source§impl Clone for CargoManifest
impl Clone for CargoManifest
Source§fn clone(&self) -> CargoManifest
fn clone(&self) -> CargoManifest
Returns a duplicate 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 moreSource§impl Debug for CargoManifest
impl Debug for CargoManifest
Auto Trait Implementations§
impl Freeze for CargoManifest
impl RefUnwindSafe for CargoManifest
impl Send for CargoManifest
impl Sync for CargoManifest
impl Unpin for CargoManifest
impl UnsafeUnpin for CargoManifest
impl UnwindSafe for CargoManifest
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