Pre-1.0: signatures are not frozen. Generated from rustdoc JSON of the compiled crate; rustdoc JSON format version 60. Only public items are listed.
Typed named-resource dictionaries for authored assets and themes.
This module owns authored data only: validated non-secret literals, opaque host resource descriptors and aliases between named entries of one dictionary. It never renders, authorizes, or carries host payloads. A host resource is a typed handle; its bytes stay in the host process.
Structs
structaster_blueprint::asset::AssetLibrary
pub struct AssetLibrary { /* see fields */ }A named library of reusable assets.
A node whose definition matches a library asset name is a macro instance. The asset is expanded in place of that node; the node itself does not survive into the expanded graph.
Methods
fn new() -> Selffn insert(&mut self, asset: Symbol, source: GraphSource) -> Result<(), AssetError>fn get(&self, asset: &Symbol) -> Option<&GraphSource>fn contains(&self, asset: &Symbol) -> boolfn names(&self) -> impl Iterator<Item = &Symbol>fn len(&self) -> usizefn is_empty(&self) -> bool
Trait implementations: Debug, Default
structaster_blueprint::asset::ExpandedAsset
pub struct ExpandedAsset { /* see fields */ }The result of expanding an asset into a flat graph.
Public fields
| field | type | |
|---|---|---|
asset | model::Symbol | The expanded asset name. |
nodes | Vec<ExpandedNode> | Expanded nodes in deterministic order. |
parameters | Vec<model::ParameterSpec> | The parameters of the expanded asset. Child asset parameters are substituted, not carried over. |
outputs | Vec<model::OutputSpec> | The exposed outputs of the expanded asset, rerouted to real nodes. |
instances | usize | Number of macro instances that were expanded. |
depth | usize | Deepest expansion depth that was reached. |
Methods
fn node_count(&self) -> usizefn provenance(&self, key: &NodeKey) -> Option<&Provenance>— Provenance of an expanded node, addressed by its expanded key.fn materialize(&self, asset: Symbol, limits: Limits) -> Result<GraphSource, AssetError>— Builds a real source graph from the expansion.
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::asset::ExpandedNode
pub struct ExpandedNode { /* see fields */ }An expanded node with its provenance.
Public fields
| field | type | |
|---|---|---|
node | model::NodeSpec | |
provenance | Provenance |
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::asset::HostResource
pub struct HostResource { /* see fields */ }Opaque host-owned resource descriptor.
The blueprint stores the handle and the declared type only. The host keeps the payload, and nothing here proves a renderer can present it.
Public fields
| field | type | |
|---|---|---|
id | model::Symbol | |
value_type | model::ValueType |
Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq
structaster_blueprint::asset::Provenance
pub struct Provenance { /* see fields */ }Where an expanded node came from.
Public fields
| field | type | |
|---|---|---|
scope | ScopePath | Scope path of the expanded node. |
origin_asset | model::Symbol | The library asset that authored the node. |
origin_key | model::NodeKey | The authored node key inside that asset. |
origin_stamp | model::SourceStamp | The source stamp of that asset at expansion time. |
Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq
structaster_blueprint::asset::ResolvedResources
pub struct ResolvedResources { /* see fields */ }Fully resolved resource dictionary.
Methods
fn len(&self) -> usizefn is_empty(&self) -> boolfn value(&self, name: &Symbol) -> Option<&ResolvedValue>fn value_type(&self, name: &Symbol) -> Option<ValueType>fn names(&self) -> impl Iterator<Item = &Symbol>fn resource_types(&self) -> &BTreeMap<Symbol, ValueType>— Name to declared type map. This is the seam for a compiler environment resource table; it carries types only, never payloads.
Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::asset::ResourceDictionary
pub struct ResourceDictionary { /* see fields */ }A typed dictionary of named resources.
Entries are authored data. Aliases resolve inside this dictionary only.
Methods
fn new() -> Selffn with_limits(limits: ResourceLimits) -> Selffn limits(&self) -> ResourceLimitsfn len(&self) -> usizefn is_empty(&self) -> boolfn get(&self, name: &Symbol) -> Option<&ResourceEntry>fn contains(&self, name: &Symbol) -> boolfn names(&self) -> impl Iterator<Item = &Symbol>fn entries(&self) -> &BTreeMap<Symbol, ResourceEntry>fn define(&mut self, name: Symbol, entry: ResourceEntry) -> Result<(), AssetError>— Authors a new named resource. A repeated name is refused; the dictionary is left unchanged.fn set(&mut self, name: Symbol, entry: ResourceEntry) -> Result<(), AssetError>— Inserts or replaces a named resource. This is the wholesale operation; it may change the declared type and the value kind.fn remove(&mut self, name: &Symbol) -> Result<ResourceEntry, AssetError>— Removes a named resource. An absent name is refused.fn apply_edits(&self, edits: &[ResourceEdit]) -> Result<ResourceDictionary, AssetError>— Applies edits to a candidate copy. The receiver is never modified.fn resolve(&self) -> Result<ResolvedResources, AssetError>— Resolves every alias and returns the effective values and types.
Trait implementations: Clone, Debug, Default, PartialEq, StructuralPartialEq
structaster_blueprint::asset::ResourceEntry
pub struct ResourceEntry { /* see fields */ }One named resource: a declared type plus the authored value.
Public fields
| field | type | |
|---|---|---|
value_type | model::ValueType | |
value | ResourceValue |
Methods
fn literal(value: Literal) -> Selffn host(id: Symbol, value_type: ValueType) -> Selffn alias(target: Symbol, value_type: ValueType) -> Selffn kind(&self) -> ResourceKind
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
structaster_blueprint::asset::ResourceLimits
pub struct ResourceLimits { /* see fields */ }Caller-selected authoring bounds; payload counts do not measure total RSS.
Public fields
| field | type | |
|---|---|---|
entries | usize | |
literal_bytes | usize | |
alias_depth | usize | |
resolved_literal_bytes | usize |
Trait implementations: Clone, Copy, Debug, Default, Eq, PartialEq, StructuralPartialEq
structaster_blueprint::asset::ScopePath
pub struct ScopePath { /* see fields */ }Stable identity of one expansion scope.
The path names the macro instance chain that produced a node, so two instances of the same asset stay distinguishable.
Methods
fn root() -> Selffn steps(&self) -> &[ScopeStep]fn child(&self, step: ScopeStep) -> Selffn as_string(&self) -> String
Trait implementations: Clone, Debug, Default, Eq, PartialEq, StructuralPartialEq
structaster_blueprint::asset::ScopeStep
pub struct ScopeStep { /* see fields */ }One step of an expansion scope path.
Public fields
| field | type | |
|---|---|---|
asset | model::Symbol | The library asset expanded at this step. |
instance | model::NodeKey | The authored key of the macro instance node in the parent scope. |
Trait implementations: Clone, Debug, Eq, PartialEq, StructuralPartialEq
Enums
enumaster_blueprint::asset::AssetError
pub enum AssetError { ResourceCapacity, DuplicateResource, UnknownResource, ResourceCycle, ResourceTypeMismatch, ResourceKindMismatch, InvalidLiteral, DuplicateAsset, UnknownAsset, UnknownNode, MissingParameter, UnknownParameter, ParameterTypeMismatch, MissingOutput, OutputTypeMismatch, AssetCycle, DepthLimit, InstanceLimit, NodeLimit, ConnectionLimit, BindingLimit, LiteralLimit, KeyExhausted, Model }Variants
ResourceCapacityDuplicateResourceUnknownResourceResourceCycleResourceTypeMismatchResourceKindMismatchInvalidLiteralDuplicateAssetUnknownAssetUnknownNodeMissingParameterUnknownParameterParameterTypeMismatchMissingOutputOutputTypeMismatchAssetCycleDepthLimitInstanceLimitNodeLimitConnectionLimitBindingLimitLiteralLimitKeyExhaustedModel
Trait implementations: Clone, Debug, Display, Eq, Error, From<AssetError>, PartialEq, StructuralPartialEq
enumaster_blueprint::asset::ResolvedValue
pub enum ResolvedValue { Literal, Host }The effective value of a name after alias resolution.
Methods
fn value_type(&self) -> ValueType
Variants
LiteralHost
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
enumaster_blueprint::asset::ResourceEdit
pub enum ResourceEdit { Patch, Replace, Remove }A change to a resource dictionary.
Variants
Patch— Partial update of an existing entry. The entry must exist, and it keeps its declared type and value kind.Replace— Wholesale replacement. May introduce a new declared type and kind.Remove— Removal of an existing entry.
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
enumaster_blueprint::asset::ResourceKind
pub enum ResourceKind { Literal, Host, Alias }Which authored shape a resource entry holds.
Variants
LiteralHostAlias
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_blueprint::asset::ResourceValue
pub enum ResourceValue { Literal, Host, Alias }Methods
fn kind(&self) -> ResourceKindfn value_type(&self) -> Option<ValueType>— Declared type of a terminal value. Aliases have no own type until they are resolved against their target.
Variants
Literal— Validated, non-secret authored literal payload.Host— Opaque handle to a host-owned resource.Alias— Alias to another entry of the same dictionary.
Trait implementations: Clone, Debug, PartialEq, StructuralPartialEq
Functions
fnaster_blueprint::asset::expand
pub fn expand(source: &model::GraphSource, library: &AssetLibrary, resources: &std::collections::BTreeMap<model::Symbol, model::ValueType>, limits: model::Limits) -> Result<ExpandedAsset, AssetError>Expands a reusable asset graph into a flat, deterministic graph.
A node whose definition names a library asset is a macro instance. Its input ports bind the parameter specifications of that asset, and the exposed outputs of that asset are rerouted to the nodes that produced them. Expansion is bounded in nodes, connections, bindings, literal bytes, depth and instance count, and recursive asset cycles are refused.