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.
Placed material-layer composition over the existing Aster scene.
A material part is a caller-owned root with placed material layers. The caller owns the root model key, the root bounds, every layer's placement and every layer's surface content. This module composes; it never invents a child model key, never derives geometry from a role, and never admits a shadow, a mask, an arbitrary clip or a shader of its own.
Roles are ordering only: Outside paints first (below), Inside next and
Outline last (above). An outline layer is exactly what the caller
placed, never an automatic stroke around another layer.
The composition is stateless: [LayeredPart] keeps node identities only,
and [LayeredPart::update] takes &self, so a refused or discarded edit
cannot advance any payload, geometry or identity cache. The caller adopts
the returned handle only after the real Edit::commit succeeds, exactly
like the existing Aster controls.
The core opaque Recording commit_for_output seam is reserved for
an internal component and is not available here: this module composes ordinary Aster
scene nodes and leaves rendering, output commit and every backend seam to
the existing renderer work.
Structs
structaster_blueprint::material_layers::LayerBudget
pub struct LayerBudget { /* see fields */ }The caller's admission budget for one part.
The budget is checked before any scene write, so an over-budget part never touches the accepted scene.
Public fields
| field | type | |
|---|---|---|
layers | usize | The maximum number of layers in one part. |
nodes | usize | The maximum number of nodes in one part: the root plus its layers. |
Trait implementations: Clone, Copy, Debug, Default
structaster_blueprint::material_layers::LayerSpec
pub struct LayerSpec { /* see fields */ }One placed material layer of a part.
Public fields
| field | type | |
|---|---|---|
key | model::Symbol | The caller's key for this layer. It is unique inside one part. |
role | LayerRole | The ordering role of this layer. |
bounds | aster_ui::LogicalRect | The placed bounds of this layer, in the part root's local space. |
radius | Option<f64> | Overrides the part radius for this layer alone. |
clip | Option<aster_ui::Clip> | Overrides the part clip for this layer alone. |
surface | aster_ui::component::Surface | The caller's surface content for this layer. |
Trait implementations: Clone, Debug
structaster_blueprint::material_layers::LayeredPart
pub struct LayeredPart { /* see fields */ }An immutable placed-material part: the root node and its layer nodes.
The handle retains identities only. It never caches a payload, a geometry or a command count, so an update that is refused or discarded cannot advance it.
Methods
fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &PartSpec, budget: &LayerBudget) -> Result<Self, LayerError>— Inserts a placed material part into an open scene edit.fn update(&self, edit: &mut Edit<'_>, spec: &PartSpec, budget: &LayerBudget) -> Result<usize, LayerError>— Updates a placed part in an open scene edit, keeping every node id.fn root(&self) -> NodeId— The root node of the part.fn model_key(&self) -> ModelKey— The explicit model key of the part root.fn node(&self, key: &Symbol) -> Option<NodeId>— The node of one placed layer, by the caller's key.fn layers(&self) -> impl Iterator<Item = (&Symbol, LayerRole, NodeId)>— The placed layers, in paint order: outside, then inside, then outline.fn layer_count(&self) -> usize— The number of placed layers.
Trait implementations: Clone, Debug
structaster_blueprint::material_layers::PartSpec
pub struct PartSpec { /* see fields */ }The caller-owned root identity, placement and layer set of one part.
Public fields
| field | type | |
|---|---|---|
key | aster_ui::ModelKey | The explicit model key of the part root. |
bounds | aster_ui::LogicalRect | The explicit bounds of the part root, in the parent's space. |
clip | aster_ui::Clip | The clip applied to the part root subtree. |
radius | f64 | The default corner radius of the painted layers. |
layers | Vec<LayerSpec> | The placed layers, in caller order. |
Trait implementations: Clone, Debug
Enums
enumaster_blueprint::material_layers::LayerError
pub enum LayerError { Aster, RootKeyChanged, DuplicateKey, UnknownKey, MissingKey, RoleChanged, OrderChanged, LayerBudget, NodeBudget, InvalidGeometry, CommandOverflow, ForeignScene, RadiusUnsupported }The refusal of a placed material composition.
Variants
Aster— The Aster scene refused the write.RootKeyChanged— Updating a placed handle cannot replace its root model key.DuplicateKey— Two layers of one part share a caller key.UnknownKey— The update introduces a layer key the part does not own.MissingKey— The update drops a layer key the part owns.RoleChanged— The update moves a layer into another role.OrderChanged— The update reorders the layers inside one role.LayerBudget— The caller's layer budget is exceeded.NodeBudget— The caller's node budget is exceeded.InvalidGeometry— A bound is not finite or is not representable as a devicef32.CommandOverflow— The total command count overflowed.ForeignScene— The edit does not own this part's nodes.RadiusUnsupported— A radius was asked for a surface that cannot carry one.
Trait implementations: Debug, Display, Error, From<Error>
enumaster_blueprint::material_layers::LayerRole
pub enum LayerRole { Outside, Inside, Outline }The ordering role of a placed material layer.
A role only decides the paint order of the layers. It never creates geometry, never implies a stroke, a shadow or a mask.
Variants
Outside— Painted below every other role.Inside— Painted above the outside layers.Outline— Painted above every other role.
Trait implementations: Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, StructuralPartialEq
Functions
fnaster_blueprint::material_layers::command_count
pub fn command_count(spec: &PartSpec) -> Result<usize, LayerError>The checked total command count of one part specification.
A painted layer costs one command, an empty layer costs none and a recording layer costs its own command count. The sum is checked, so an unrepresentable count is refused instead of wrapping.