Struct cargo_toml::TomlManifest
source · pub struct TomlManifest<Metadata = Value> {
pub package: TomlPackage<Metadata>,
pub dependencies: TomlDepsSet,
pub dev_dependencies: TomlDepsSet,
pub build_dependencies: TomlDepsSet,
pub target: TomlPlatformDepsSet,
pub features: TomlFeatureSet,
pub bin: Vec<TomlLibOrBin>,
pub lib: Option<TomlLibOrBin>,
pub profile: TomlProfiles,
}
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: TomlPackage<Metadata>
§dependencies: TomlDepsSet
§dev_dependencies: TomlDepsSet
§build_dependencies: TomlDepsSet
§target: TomlPlatformDepsSet
§features: TomlFeatureSet
§bin: Vec<TomlLibOrBin>
Note that due to autobins feature this is not the complete list
lib: Option<TomlLibOrBin>
Note that due to autolibs feature this is not the complete list
profile: TomlProfiles
Implementations§
source§impl TomlManifest<Value>
impl TomlManifest<Value>
sourcepub fn from_slice(cargo_toml_content: &[u8]) -> Result<Self, Error>
pub fn from_slice(cargo_toml_content: &[u8]) -> Result<Self, Error>
Parse contents of a Cargo.toml
file loaded as a byte slice
source§impl<Metadata: for<'a> Deserialize<'a>> TomlManifest<Metadata>
impl<Metadata: for<'a> Deserialize<'a>> TomlManifest<Metadata>
sourcepub fn from_slice_with_metadata(
cargo_toml_content: &[u8]
) -> Result<Self, Error>
pub fn from_slice_with_metadata(
cargo_toml_content: &[u8]
) -> Result<Self, Error>
Parse Cargo.toml
, and parse its [package.metadata]
into a custom Serde-compatible type
Trait Implementations§
source§impl<Metadata: Clone> Clone for TomlManifest<Metadata>
impl<Metadata: Clone> Clone for TomlManifest<Metadata>
source§fn clone(&self) -> TomlManifest<Metadata>
fn clone(&self) -> TomlManifest<Metadata>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<Metadata: Debug> Debug for TomlManifest<Metadata>
impl<Metadata: Debug> Debug for TomlManifest<Metadata>
source§impl<'de, Metadata> Deserialize<'de> for TomlManifest<Metadata>where
Metadata: Deserialize<'de>,
impl<'de, Metadata> Deserialize<'de> for TomlManifest<Metadata>where
Metadata: Deserialize<'de>,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more