pub struct Manifest<Metadata = Value> {
Show 16 fields pub package: Option<Package<Metadata>>, pub workspace: Option<Workspace<Metadata>>, pub dependencies: DepsSet, pub dev_dependencies: DepsSet, pub build_dependencies: DepsSet, pub target: TargetDepsSet, pub features: FeatureSet, pub replace: DepsSet, pub patch: PatchSet, pub lib: Option<Product>, pub profile: Profiles, pub badges: Badges, pub bin: Vec<Product>, pub bench: Vec<Product>, pub test: Vec<Product>, pub example: Vec<Product>,
}
Expand description

The top-level Cargo.toml structure

The Metadata is a type for [package.metadata] table. You can replace it with your own struct type if you use the metadata and don’t want to use the catch-all Value type.

Fields

package: Option<Package<Metadata>>workspace: Option<Workspace<Metadata>>dependencies: DepsSetdev_dependencies: DepsSetbuild_dependencies: DepsSettarget: TargetDepsSetfeatures: FeatureSetreplace: DepsSet
👎Deprecated:

Cargo recommends patch instead

patch: PatchSetlib: Option<Product>

Note that due to autolibs feature this is not the complete list unless you run complete_from_path

profile: Profilesbadges: Badgesbin: Vec<Product>

Note that due to autobins feature this is not the complete list unless you run complete_from_path

bench: Vec<Product>test: Vec<Product>example: Vec<Product>

Implementations

Parse contents of a Cargo.toml file already loaded as a byte slice.

It does not call complete_from_path, so may be missing implicit data.

Parse contents from a Cargo.toml file on disk.

Calls complete_from_path.

Parse contents of a Cargo.toml file loaded as a string

Note: this is not a file name, but file’s content. See from_path.

It does not call complete_from_path, so may be missing implicit data.

Parse Cargo.toml, and parse its [package.metadata] into a custom Serde-compatible type.package

It does not call complete_from_path, so may be missing implicit data.

Parse contents from Cargo.toml file on disk, with custom Serde-compatible metadata type.

Calls complete_from_path

Cargo.toml doesn’t contain explicit information about [lib] and [[bin]], which are inferred based on files on disk.

This scans the disk to make the data in the manifest as complete as possible.

Cargo.toml doesn’t contain explicit information about [lib] and [[bin]], which are inferred based on files on disk.

You can provide any implementation of directory scan, which doesn’t have to be reading straight from disk (might scan a tarball or a git repo, for example).

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.