pub struct Package<'a> { /* private fields */ }Expand description
A view of the package section of a Cargo manifest.
Implementations§
Source§impl<'a> Package<'a>
impl<'a> Package<'a>
Sourcepub fn version(&self) -> Result<Version, SpannedError<PackageError>>
pub fn version(&self) -> Result<Version, SpannedError<PackageError>>
Parses and returns the package version.
Sourcepub fn config(
&self,
) -> Result<Option<CodegenConfig>, SpannedError<PackageError>>
pub fn config( &self, ) -> Result<Option<CodegenConfig>, SpannedError<PackageError>>
Deserializes package.metadata.ploidy into a CodegenConfig.
Returns Ok(None) if the section is absent, or Err if
it’s present but malformed.
Trait Implementations§
impl<'a> Copy for Package<'a>
Auto Trait Implementations§
impl<'a> Freeze for Package<'a>
impl<'a> !RefUnwindSafe for Package<'a>
impl<'a> !Send for Package<'a>
impl<'a> !Sync for Package<'a>
impl<'a> Unpin for Package<'a>
impl<'a> UnsafeUnpin for Package<'a>
impl<'a> !UnwindSafe for Package<'a>
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