API reference

aster_blueprint::asset

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() -> Self
  • fn insert(&mut self, asset: Symbol, source: GraphSource) -> Result<(), AssetError>
  • fn get(&self, asset: &Symbol) -> Option<&GraphSource>
  • fn contains(&self, asset: &Symbol) -> bool
  • fn names(&self) -> impl Iterator<Item = &Symbol>
  • fn len(&self) -> usize
  • fn 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

fieldtype
assetmodel::SymbolThe expanded asset name.
nodesVec<ExpandedNode>Expanded nodes in deterministic order.
parametersVec<model::ParameterSpec>The parameters of the expanded asset. Child asset parameters are substituted, not carried over.
outputsVec<model::OutputSpec>The exposed outputs of the expanded asset, rerouted to real nodes.
instancesusizeNumber of macro instances that were expanded.
depthusizeDeepest expansion depth that was reached.

Methods

  • fn node_count(&self) -> usize
  • fn 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

fieldtype
nodemodel::NodeSpec
provenanceProvenance

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

fieldtype
idmodel::Symbol
value_typemodel::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

fieldtype
scopeScopePathScope path of the expanded node.
origin_assetmodel::SymbolThe library asset that authored the node.
origin_keymodel::NodeKeyThe authored node key inside that asset.
origin_stampmodel::SourceStampThe 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) -> usize
  • fn is_empty(&self) -> bool
  • fn 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() -> Self
  • fn with_limits(limits: ResourceLimits) -> Self
  • fn limits(&self) -> ResourceLimits
  • fn len(&self) -> usize
  • fn is_empty(&self) -> bool
  • fn get(&self, name: &Symbol) -> Option<&ResourceEntry>
  • fn contains(&self, name: &Symbol) -> bool
  • fn 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

fieldtype
value_typemodel::ValueType
valueResourceValue

Methods

  • fn literal(value: Literal) -> Self
  • fn host(id: Symbol, value_type: ValueType) -> Self
  • fn alias(target: Symbol, value_type: ValueType) -> Self
  • fn 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

fieldtype
entriesusize
literal_bytesusize
alias_depthusize
resolved_literal_bytesusize

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() -> Self
  • fn steps(&self) -> &[ScopeStep]
  • fn child(&self, step: ScopeStep) -> Self
  • fn 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

fieldtype
assetmodel::SymbolThe library asset expanded at this step.
instancemodel::NodeKeyThe 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

  • ResourceCapacity
  • DuplicateResource
  • UnknownResource
  • ResourceCycle
  • ResourceTypeMismatch
  • ResourceKindMismatch
  • InvalidLiteral
  • DuplicateAsset
  • UnknownAsset
  • UnknownNode
  • MissingParameter
  • UnknownParameter
  • ParameterTypeMismatch
  • MissingOutput
  • OutputTypeMismatch
  • AssetCycle
  • DepthLimit
  • InstanceLimit
  • NodeLimit
  • ConnectionLimit
  • BindingLimit
  • LiteralLimit
  • KeyExhausted
  • Model

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

  • Literal
  • Host

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

  • Literal
  • Host
  • Alias

Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq

enumaster_blueprint::asset::ResourceValue

pub enum ResourceValue { Literal, Host, Alias }

Methods

  • fn kind(&self) -> ResourceKind
  • fn 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.