Expand description
Type-safe Cargo.toml and Cargo.lock parser using facet.
§Quick Start
use facet_cargo_toml::{CargoToml, CargoLock};
// Parse a Cargo.toml
let manifest = CargoToml::from_path("Cargo.toml")?;
if let Some(pkg) = &manifest.package {
println!("Package: {:?}", pkg.name);
}
// Parse a Cargo.lock
let lockfile = CargoLock::from_path("Cargo.lock")?;
println!("Contains {} packages", lockfile.packages.len());Structs§
- Badge
- Badge configuration (deprecated).
- Bench
Target - Benchmark target configuration from
[[bench]]. - BinTarget
- Binary target configuration from
[[bin]]. - Build
Override - Build script and proc-macro profile overrides.
- Cargo
Lock - A parsed
Cargo.lockfile. - Cargo
Toml - A parsed
Cargo.tomlmanifest. - Dependency
Detail - Detailed dependency specification.
- Example
Target - Example target configuration from
[[example]]. - IoError
- Wrapper for
std::io::Errorthat implementsFacet. - LibTarget
- Library target configuration from
[lib]. - Lint
Config - Detailed lint configuration with priority.
- Lints
- The
[lints]section for configuring compiler lints. - Lock
Package - A package entry from a
Cargo.lockfile. - Package
- The
[package]section of a Cargo.toml. - Package
Profile - Per-package profile overrides.
- Profile
- Build profile configuration from
[profile.*]. - Span
- Source span with offset and length.
- Spanned
- A value with source span tracking.
- Target
Spec - Target-specific configuration from
[target.'cfg(...)']. - Test
Target - Test target configuration from
[[test]]. - Workspace
- The
[workspace]section of a Cargo.toml. - Workspace
Dependency - Workspace dependency inheritance with optional overrides.
- Workspace
Package - Inheritable package metadata in
[workspace.package]. - Workspace
Ref - Workspace inheritance marker (
{ workspace = true }).
Enums§
- Bool
OrVec - A value that can be a boolean or array of strings.
- Debug
Level - Debug information level.
- Dependency
- A dependency specification.
- Edition
- Rust edition year.
- Edition
OrWorkspace - A value that can be a direct edition or inherited from workspace.
- Error
- Errors that can occur when parsing
Cargo.tomlorCargo.lockfiles. - Lint
Level - Lint level configuration.
- Lint
Level String - Simple lint level string.
- Lto
- Link-time optimization setting.
- OptLevel
- Optimization level (0-3, “s”, or “z”).
- Panic
Strategy - Panic strategy.
- Resolver
- Cargo dependency resolver version.
- String
OrBool - A value that can be a string path or boolean.
- String
OrBool OrWorkspace - A value that can be a string, boolean, or inherited from workspace.
- String
OrWorkspace - A value that can be a direct string or inherited from workspace.
- Strip
Level - Symbol stripping level.
- VecOr
Workspace - A value that can be a direct array or inherited from workspace.
Constants§
- CRATES_
IO_ SOURCE - The crates.io registry source string in Cargo.lock.