Skip to main content

Crate facet_cargo_toml

Crate facet_cargo_toml 

Source
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).
BenchTarget
Benchmark target configuration from [[bench]].
BinTarget
Binary target configuration from [[bin]].
BuildOverride
Build script and proc-macro profile overrides.
CargoLock
A parsed Cargo.lock file.
CargoToml
A parsed Cargo.toml manifest.
DependencyDetail
Detailed dependency specification.
ExampleTarget
Example target configuration from [[example]].
IoError
Wrapper for std::io::Error that implements Facet.
LibTarget
Library target configuration from [lib].
LintConfig
Detailed lint configuration with priority.
Lints
The [lints] section for configuring compiler lints.
LockPackage
A package entry from a Cargo.lock file.
Package
The [package] section of a Cargo.toml.
PackageProfile
Per-package profile overrides.
Profile
Build profile configuration from [profile.*].
Span
Source span with offset and length.
Spanned
A value with source span tracking.
TargetSpec
Target-specific configuration from [target.'cfg(...)'].
TestTarget
Test target configuration from [[test]].
Workspace
The [workspace] section of a Cargo.toml.
WorkspaceDependency
Workspace dependency inheritance with optional overrides.
WorkspacePackage
Inheritable package metadata in [workspace.package].
WorkspaceRef
Workspace inheritance marker ({ workspace = true }).

Enums§

BoolOrVec
A value that can be a boolean or array of strings.
DebugLevel
Debug information level.
Dependency
A dependency specification.
Edition
Rust edition year.
EditionOrWorkspace
A value that can be a direct edition or inherited from workspace.
Error
Errors that can occur when parsing Cargo.toml or Cargo.lock files.
LintLevel
Lint level configuration.
LintLevelString
Simple lint level string.
Lto
Link-time optimization setting.
OptLevel
Optimization level (0-3, “s”, or “z”).
PanicStrategy
Panic strategy.
Resolver
Cargo dependency resolver version.
StringOrBool
A value that can be a string path or boolean.
StringOrBoolOrWorkspace
A value that can be a string, boolean, or inherited from workspace.
StringOrWorkspace
A value that can be a direct string or inherited from workspace.
StripLevel
Symbol stripping level.
VecOrWorkspace
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.