pub struct AssetManifest {
pub version: u32,
pub writer: String,
pub app: String,
pub build: String,
pub aliases: HashMap<String, String>,
pub assets: HashMap<String, AssetMetadata>,
pub routes: HashMap<String, RouteAssets>,
}Expand description
Validated schema-2 build manifest. Deserialize through the shared validator.
Fields§
§version: u32Manifest schema, currently 2.
writer: StringWriter’s numeric base version, without package prerelease metadata.
app: StringApplication identity; the same grammar as the worker namespace.
build: StringThe build’s deployment identity (FORMA-186, DR-29): @getforma/build computes
it from the build’s own outputs and compiles it into every bundle, and this
server writes it on the page’s root as data-forma-build, where core
compares it with its bundle’s before it activates anything. Opaque here: any
non-empty string, written escaped.
aliases: HashMap<String, String>Logical names mapped to emitted filenames.
assets: HashMap<String, AssetMetadata>Metadata keyed by emitted filenames, including retained files.
routes: HashMap<String, RouteAssets>Explicit rendering mode and assets for each route.
Implementations§
Source§impl AssetManifest
impl AssetManifest
Sourcepub fn from_json(json: &str) -> Result<Self, String>
pub fn from_json(json: &str) -> Result<Self, String>
Read and validate schema, versions, modes and references at startup.
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Revalidate even a manifest constructed by the caller before loading modules.
Sourcepub fn resolve<'a>(&'a self, logical_name: &'a str) -> &'a str
pub fn resolve<'a>(&'a self, logical_name: &'a str) -> &'a str
Resolve a logical name through the manifest’s explicit aliases.
Sourcepub fn route(&self, pattern: &str) -> Option<&RouteAssets>
pub fn route(&self, pattern: &str) -> Option<&RouteAssets>
Get assets and the declared mode for a route.