Skip to main content

Package

Struct Package 

Source
pub struct Package {
Show 28 fields pub name: Option<String>, pub authors: Vec<String>, pub version: Option<Inheritable<String>>, pub edition: Option<Inheritable<Edition>>, pub rust_version: Option<Inheritable<String>>, pub build: Option<OptionalFile>, pub workspace: Option<PathBuf>, pub links: Option<String>, pub description: Option<Inheritable<String>>, pub homepage: Option<Inheritable<String>>, pub documentation: Option<Inheritable<String>>, pub readme: Option<Inheritable<OptionalFile>>, pub keywords: Inheritable<BTreeSet<String>>, pub categories: Inheritable<BTreeSet<String>>, pub exclude: Inheritable<BTreeSet<String>>, pub include: Inheritable<BTreeSet<String>>, pub license: Option<Inheritable<String>>, pub license_file: Option<Inheritable<PathBuf>>, pub repository: Option<Inheritable<String>>, pub default_run: Option<String>, pub autobins: Option<bool>, pub autolib: Option<bool>, pub autoexamples: Option<bool>, pub autotests: Option<bool>, pub autobenches: Option<bool>, pub publish: Option<Inheritable<Publish>>, pub resolver: Option<Resolver>, pub metadata: BTreeMap<String, Value>,
}
Expand description

The [package] section of the Manifest. This is where crate properties are.

Fields§

§name: Option<String>

The name of the crate.

§authors: Vec<String>

Deprecated

§version: Option<Inheritable<String>>

Must parse as semver, e.g. “1.9.0”

§edition: Option<Inheritable<Edition>>

Package’s edition opt-in.

§rust_version: Option<Inheritable<String>>

MSRV 1.x (beware: does not require semver formatting)

§build: Option<OptionalFile>

Build script definition.

§workspace: Option<PathBuf>

Workspace this package is a member of (None if it’s implicit).

§links: Option<String>

Name of the native library the package links with.

§description: Option<Inheritable<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<Inheritable<String>>

Project’s homepage.

§documentation: Option<Inheritable<String>>

Path to your custom docs. Unnecessary if you rely on docs.rs.

§readme: Option<Inheritable<OptionalFile>>

This points to a file under the package root (relative to this Cargo.toml). implied if README.md, README.txt or README exists.

§keywords: Inheritable<BTreeSet<String>>

Up to 5, for search.

§categories: Inheritable<BTreeSet<String>>

This is a list of up to five categories where this crate would fit.

§exclude: Inheritable<BTreeSet<String>>

Don’t publish these files

§include: Inheritable<BTreeSet<String>>

Publish these files

§license: Option<Inheritable<String>>

e.g. “MIT”

§license_file: Option<Inheritable<PathBuf>>

If license is not standard

§repository: Option<Inheritable<String>>

(HTTPS) URL to crate’s repository

§default_run: Option<String>

The default binary to run by cargo run.

§autobins: Option<bool>

Discover binaries from the file system

§autolib: Option<bool>

Discover libraries from the file system

§autoexamples: Option<bool>

Discover examples from the file system

§autotests: Option<bool>

Discover tests from the file system

§autobenches: Option<bool>

Discover benchmarks from the file system

§publish: Option<Inheritable<Publish>>

Disable publishing or select custom registries.

§resolver: Option<Resolver>

The feature resolver version.

§metadata: BTreeMap<String, Value>

Arbitrary metadata of any type, an extension point for 3rd party tools.

Trait Implementations§

Source§

impl Clone for Package

Source§

fn clone(&self) -> Package

Returns a duplicate 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 Debug for Package

Source§

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

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

impl Default for Package

Source§

fn default() -> Package

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Package

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 Merge for Package

Source§

fn merge(&mut self, other: Self)

Source§

impl PartialEq for Package

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Package

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 Eq for Package

Source§

impl StructuralPartialEq for Package

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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,

Source§

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>,

Source§

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>,

Source§

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>,