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: StringOpaque build identifier. Deployment identity is owned by FORMA-186.
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.
Trait Implementations§
Source§impl Clone for AssetManifest
impl Clone for AssetManifest
Source§impl Debug for AssetManifest
impl Debug for AssetManifest
Source§impl<'de> Deserialize<'de> for AssetManifest
impl<'de> Deserialize<'de> for AssetManifest
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AssetManifest
impl RefUnwindSafe for AssetManifest
impl Send for AssetManifest
impl Sync for AssetManifest
impl Unpin for AssetManifest
impl UnsafeUnpin for AssetManifest
impl UnwindSafe for AssetManifest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more