Expand description
Manifest types, parser, interpolation, and JSON Schema generation for LightShuttle.
This crate is the leaf layer of the LightShuttle workspace: it carries
zero internal dependencies and is consumed by every other crate in the
graph (lightshuttle-spec, lightshuttle-runtime, lightshuttle-export,
and the facade lightshuttle). Any type that appears in a
lightshuttle.yml manifest is defined here.
§What this crate provides
- A strongly-typed model of
lightshuttle.ymlrooted atManifest. The model isserde-annotated for both serialisation and JSON Schema generation viaschemars. Manifest::parse: one-shot YAML parsing combined with semantic validation (naming rules, dependency cycle detection, reference checking). Returns aManifestErroron the first problem found.Manifest::to_yaml: lossless round-trip serialisation back to YAML.Manifest::validate: the semantic validation pass in isolation, callable after building a manifest programmatically.Manifest::resolve_host_volume_paths: rewrites relativesrcpaths in volume mappings to absolute paths anchored on the manifest directory.Interpolator+InterpolationContext: resolution of${...}expressions in string fields, supporting${env.NAME}and${resources.name.property}references.schema: generates the JSON Schema consumed by editor tooling and thecargo xtask schemasubcommand.
§Quick start
use lightshuttle_manifest::Manifest;
let yaml = r#"
project:
name: my-app
resources:
db:
postgres:
version: "16"
"#;
let manifest = Manifest::parse(yaml).expect("valid manifest");
assert_eq!(manifest.project.name, "my-app");See the Manifest, ResourceKind, and interpolate module for
detailed documentation.
§Specification
The YAML format this crate implements is described in
docs/spec/manifest-v0.md in the main repository.
Re-exports§
pub use crate::interpolate::InterpolationContext;pub use crate::interpolate::Interpolator;pub use crate::interpolate::Reference;pub use crate::model::Command;pub use crate::model::ComposeExport;pub use crate::model::ComposeResourceExport;pub use crate::model::ContainerConfig;pub use crate::model::DashboardConfig;pub use crate::model::DockerfileConfig;pub use crate::model::ExportConfig;pub use crate::model::Healthcheck;pub use crate::model::HelmExport;pub use crate::model::HelmResourceExport;pub use crate::model::ImagePullPolicy;pub use crate::model::KubernetesExport;pub use crate::model::KubernetesResourceExport;pub use crate::model::Manifest;pub use crate::model::ObservabilityConfig;pub use crate::model::OtelConfig;pub use crate::model::PortMapping;pub use crate::model::PostgresConfig;pub use crate::model::Project;pub use crate::model::RedisConfig;pub use crate::model::ResourceKind;pub use crate::model::Version;pub use crate::model::Volume;
Modules§
- interpolate
- Substitution engine for
${...}interpolations in manifest string values. Substitution engine for${...}interpolations in manifest string values. - model
- Strongly-typed model of a
lightshuttle.ymlmanifest. Strongly-typed model of a LightShuttle manifest.
Enums§
- Manifest
Error - Errors raised while parsing, validating or interpolating a manifest.
Functions§
- schema
- Build the JSON Schema describing a valid
lightshuttle.yml.
Type Aliases§
- Result
- Shorthand for
std::result::Result<T, ManifestError>.