basic lockfile and manifest structs

This commit is contained in:
mae
2026-07-13 09:00:44 -05:00
parent 9d4c3e911e
commit 1825b9a90b
2 changed files with 64 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
package feynman
type CargoLock struct {
Packages []LockPackage `toml:"package"`
}
type LockPackage struct {
Name string `toml:"name"`
Version string `toml:"version"`
Dependencies []string `toml:"dependencies"`
Source string `toml:"source"`
Checksum string `toml:"checksum"`
}
+51
View File
@@ -0,0 +1,51 @@
package feynman
type CargoManifest struct {
Package `toml:"package"`
Library Target `toml:"lib"`
Binaries []Target `toml:"bin"`
Tests []Target `toml:"test"`
Dependencies map[string]Dependency `toml:"dependencies"`
BuildDependencies map[string]Dependency `toml:"build-dependencies"`
DevDependencies map[string]Dependency `toml:"dev-dependencies"`
Target TargetTable `toml:"target"`
}
type Package struct {
Name string `toml:"name"`
Version string `toml:"version"`
Edition string `toml:"edition"`
RustVersion string `toml:"rust-version"`
Workspace string `toml:"workspace"`
Build string `toml:"build"`
Links string `toml:"links"`
Autolib bool `toml:"autolib"`
Autobins bool `toml:"autobins"`
Autotests bool `toml:"autotests"`
Resolver string `toml:"resolver"`
}
type Target struct {
Name string `toml:"name"`
Path string `toml:"path"`
Test bool `toml:"test"`
ProcMacro bool `toml:"proc-macro"`
Harness bool `toml:"harness"`
CrateType []string `toml:"crate-type"`
RequiredFeatures []string `toml:"required-features"`
}
// n.b. only crates.io and local dependencies are supported.
type Dependency struct {
Version string `toml:"version"`
Path string `toml:"path"`
DefaultFeatures bool `toml:"default-features"`
Features []string `toml:"features"`
Optional bool `toml:"optional"`
Package string `toml:"package"`
Workspace string `toml:"workspace"`
}
type DependenciesTable struct {
Dependencies map[string]Dependency `toml:"dependencies"`
}
type TargetTable map[string]DependenciesTable