Expand description
This crate defines struct
s that can be deserialized with Serde
to load and inspect Cargo.toml
metadata.
See Manifest::from_path
. Note that Cargo.toml
files are not self-contained. Correct interpretation of the manifest requires other files on disk:
- List of files in order to auto-discover binaries, examples, benchmarks, and tests.
- Potentially a
Manifest
from one of parent directories, that acts as a workspace root for inheritance of shared workspace information.
Because of this filesystem-dependence, loading Cargo.toml
from a string is an advanced operation.
The crate has methods for processing this information, but if you don’t already have a full crate on disk, you will need to write some glue code to obtain it. See Manifest::complete_from_path_and_workspace
.
Structs§
- Badge
- In badges section of Cargo.toml
- Badges
[badges]
section ofCargo.toml
, deprecated by crates-io exceptmaintenance
.- Dependency
Detail - When definition of a dependency is more than just a version string.
- Filesystem
AbstractFilesystem
implementation for real files.- Inherited
Dependency Detail - When a dependency is defined as
{ workspace = true }
, and workspace data hasn’t been applied yet. - Lint
- Lint definition.
- Maintenance
- A
Badges
field withMaintenanceStatus
. - Manifest
- The top-level
Cargo.toml
structure. This is the main type in this library. - Package
- The
[package]
section of theManifest
. This is where crate properties are. - Package
Template - Workspace can predefine properties that can be inherited via
{ workspace = true }
in its member packages. - Product
- Cargo uses the term “target” for both “target platform” and “build target” (the thing to build), which makes it ambigous. Here Cargo’s bin/lib target is renamed to product.
- Profile
- Compilation/optimization settings for a workspace
- Profiles
- Build-in an custom build/optimization settings
- Target
- Dependencies that are platform-specific or enabled through custom
cfg()
. - Workspace
- A manifest can contain both a package and workspace-wide properties
Enums§
- Debug
Setting - Verbosity of debug info in a
Profile
- Dependency
- Dependency definition. Note that this struct doesn’t carry it’s key/name, which you need to read from its section.
- Edition
- Edition setting, which opts in to new Rust/Cargo behaviors.
- Error
- In this crate’s
Result
s. - Inheritable
- Placeholder for a property that may be missing from its package, and needs to be copied from a
Workspace
. - Lint
Level - Lint level.
- LtoSetting
- Handling of LTO in a build profile
- Maintenance
Status - Mainly used to deprecate crates.
- Optional
File - A way specify or disable README or
build.rs
. - Publish
- Forbids or selects custom registry
- Resolver
- The feature resolver version.
- Strip
Setting - Handling of debug symbols in a build profile
- Value
- Representation of a TOML value.
Traits§
- Abstract
Filesystem - This crate supports reading
Cargo.toml
not only from a real directory, but also directly from other sources, like tarballs or bare git repos (BYO directory reader).
Type Aliases§
- DepsSet
- Dependencies. The keys in this map are not always crate names, this can be overriden by the
package
field, and there may be multiple copies of the same crate. Optional dependencies may create implicit features, see the [features
] module for dealing with this. - Feature
Set - The
[features]
section. This set may be incomplete! - Lint
Groups - Lint groups such as [lints.rust].
- LintSet
- A set of lints.
- Patch
Set - Locally replace dependencies
- Target
Deps Set - Config target (see
parse_cfg
crate) + deps for the target.