Struct cargo_manifest::Package

source ·
pub struct Package<Metadata = Value> {
Show 27 fields pub name: String, pub edition: Option<MaybeInherited<Edition>>, pub version: Option<MaybeInherited<String>>, pub build: Option<StringOrBool>, pub workspace: Option<String>, pub authors: Option<MaybeInherited<Vec<String>>>, pub links: Option<String>, pub description: Option<MaybeInherited<String>>, pub homepage: Option<MaybeInherited<String>>, pub documentation: Option<MaybeInherited<String>>, pub readme: Option<MaybeInherited<StringOrBool>>, pub keywords: Option<MaybeInherited<Vec<String>>>, pub categories: Option<MaybeInherited<Vec<String>>>, pub license: Option<MaybeInherited<String>>, pub license_file: Option<MaybeInherited<String>>, pub repository: Option<MaybeInherited<String>>, pub metadata: Option<Metadata>, pub rust_version: Option<MaybeInherited<String>>, pub exclude: Option<MaybeInherited<Vec<String>>>, pub include: Option<MaybeInherited<Vec<String>>>, pub default_run: Option<String>, pub autobins: bool, pub autoexamples: bool, pub autotests: bool, pub autobenches: bool, pub publish: Option<MaybeInherited<Publish>>, pub resolver: Option<Resolver>,
}
Expand description

You can replace Metadata type with your own to parse into something more useful than a generic toml Value

Fields§

§name: String

Careful: some names are uppercase

§edition: Option<MaybeInherited<Edition>>§version: Option<MaybeInherited<String>>

e.g. “1.9.0”

§build: Option<StringOrBool>§workspace: Option<String>§authors: Option<MaybeInherited<Vec<String>>>

e.g. [“Author e@mail”, “etc”]

§links: Option<String>§description: Option<MaybeInherited<String>>

A short blurb about the package. This is not rendered in any format when uploaded to crates.io (aka this is not markdown).

§homepage: Option<MaybeInherited<String>>§documentation: Option<MaybeInherited<String>>§readme: Option<MaybeInherited<StringOrBool>>

This points to a file under the package root (relative to this Cargo.toml).

§keywords: Option<MaybeInherited<Vec<String>>>§categories: Option<MaybeInherited<Vec<String>>>

This is a list of up to five categories where this crate would fit. e.g. [“command-line-utilities”, “development-tools::cargo-plugins”]

§license: Option<MaybeInherited<String>>

e.g. “MIT”

§license_file: Option<MaybeInherited<String>>§repository: Option<MaybeInherited<String>>§metadata: Option<Metadata>§rust_version: Option<MaybeInherited<String>>

e.g. “1.63.0”

§exclude: Option<MaybeInherited<Vec<String>>>§include: Option<MaybeInherited<Vec<String>>>§default_run: Option<String>

The default binary to run by cargo run.

§autobins: bool§autoexamples: bool§autotests: bool§autobenches: bool§publish: Option<MaybeInherited<Publish>>§resolver: Option<Resolver>

Implementations§

source§

impl<Metadata> Package<Metadata>

source

pub fn new(name: String, version: String) -> Self

Trait Implementations§

source§

impl<Metadata: Clone> Clone for Package<Metadata>

source§

fn clone(&self) -> Package<Metadata>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Metadata: Debug> Debug for Package<Metadata>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, Metadata> Deserialize<'de> for Package<Metadata>
where Metadata: Deserialize<'de>,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<Metadata: PartialEq> PartialEq for Package<Metadata>

source§

fn eq(&self, other: &Package<Metadata>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<Metadata> Serialize for Package<Metadata>
where Metadata: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<Metadata> StructuralPartialEq for Package<Metadata>

Auto Trait Implementations§

§

impl<Metadata> Freeze for Package<Metadata>
where Metadata: Freeze,

§

impl<Metadata> RefUnwindSafe for Package<Metadata>
where Metadata: RefUnwindSafe,

§

impl<Metadata> Send for Package<Metadata>
where Metadata: Send,

§

impl<Metadata> Sync for Package<Metadata>
where Metadata: Sync,

§

impl<Metadata> Unpin for Package<Metadata>
where Metadata: Unpin,

§

impl<Metadata> UnwindSafe for Package<Metadata>
where Metadata: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,