Expand description
Shared project introspection helpers used by deploy-scaffold commands
(docker:init, do:init) and other ferro-cli commands that need to read
Cargo.toml, detect optional project directories, or resolve the Rust
toolchain version.
All helpers are deliberately tolerant of malformed or missing input: they
return safe defaults rather than propagating errors, mirroring the legacy
get_package_name() behavior they replace.
Structs§
- BinEntry
- Ferro
Deploy Metadata - Phase 122.2 §1: provider-neutral Dockerfile inputs declared by the project
in
[package.metadata.ferro.deploy]. - Project
Dirs
Functions§
- detect_
dirs - Probe the project root for the optional directories used by the deploy scaffold templates.
- find_
project_ root - Walk up from
start(or the current working directory ifNone) until a directory containingCargo.tomlis found. ReturnsNotFoundotherwise. - package_
name - Parse
<root>/Cargo.tomland return the[package] name. Returns"app"on any failure (missing file, parse error, missing key). - read_
bins - Parse
<root>/Cargo.tomland return every[[bin]]entry. If no[[bin]]table exists, synthesize one entry from[package] name. Returns an empty Vec only ifCargo.tomlis unreadable. - read_
deploy_ metadata - Read
<root>/Cargo.tomland return[package.metadata.ferro.deploy]. Missing table → defaults. Invalid field types → Err. - read_
workspace_ members - Parse
<root>/Cargo.tomland return[workspace] membersverbatim. Returns an empty Vec when no[workspace]table exists or parsing fails. - resolve_
rust_ base_ image - If
<root>/rust-toolchain.tomlexists and contains[toolchain] channel = "X.Y.Z", returnrust:X.Y.Z-slim-bookworm. Else return the hardcoded defaultrust:1.88-slim-bookworm.