API reference

aster_blueprint::presets

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.

A reusable themed card preset over the existing blueprint vocabulary.

This module authors exactly one reusable thing: a color-fill card. It reuses the existing theme layer (Theme, ThemeInstance), the existing typed resource dictionary (ResourceEntry), the existing builtin catalog (core.rect.v1, core.color.mix.v1), the existing compiler and the existing retained runtime. It adds no kernel, no model type, no renderer, no router and no host authority: every value it produces is a value the current code already computes.

The theme is the shared, global vocabulary. A ThemeInstance overlays local overrides on it. Two instances may share one Arc<Theme> and one Arc<Plan>; a local override of one instance never reaches the other.

Exported by the experimental blueprint crate; tests use its public module.

Structs

structaster_blueprint::presets::CardOptions

pub struct CardOptions { /* see fields */ }

Caller-chosen default geometry of the card.

The values are parameter defaults of the card graph, not baked literals: the caller may replace them at evaluation time through the real parameter plane.

Public fields

fieldtype
xf64
yf64
widthf64
heightf64

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

structaster_blueprint::presets::ThemeResources

pub struct ThemeResources<'a> { /* see fields */ }

Borrows already resolved theme values for evaluation.

The snapshot is resolved once, when the theme changes, and the resolver clones only the single literal a binding asks for. It never resolves or clones the whole theme per frame.

Methods

  • fn new(resolved: &'a ResolvedResources) -> Self
  • fn resolved(&self) -> &'a ResolvedResources — The resolved snapshot this resolver borrows.

Trait implementations: Clone, Copy, Debug, ResourceResolver

Enums

enumaster_blueprint::presets::PresetError

pub enum PresetError { Model, Asset, Compile, Geometry }

A refusal of the preset layer. It never carries a rendered value.

Variants

  • Model — An authored name or literal was refused by the model layer.
  • Asset — A theme resource edit was refused by the theme layer.
  • Compile — The card graph was refused by the compiler.
  • Geometry — The requested card geometry cannot produce a valid rect.

Trait implementations: Debug, Display, Error, From<AssetError>, From<CompileError>, From<ModelError>

Functions

fnaster_blueprint::presets::card

pub fn card(asset: model::Symbol, options: CardOptions) -> Result<model::GraphSource, PresetError>

The color-fill card graph.

The graph is the existing core.rect.v1 node plus the existing core.color.mix.v1 node. The rect reads the four caller-defaulted geometry parameters; the mix reads the theme resources [CARD_FILL] and [ACCENT] and the [PARAM_ACCENT_MIX] parameter. The graph declares the outputs [OUTPUT_BOUNDS] (LogicalRect) and [OUTPUT_FILL] (Srgb8).

fnaster_blueprint::presets::card_key

pub fn card_key() -> model::NodeKey

Node key of the card rect node, used by the retained visual.

fnaster_blueprint::presets::card_spec

pub fn card_spec(model_key: aster_ui::ModelKey) -> retained::VisualSpec

The visual specification of one card.

The key is the rect node key of the card graph, the bounds output is [OUTPUT_BOUNDS] and the content is the [OUTPUT_FILL] color.

fnaster_blueprint::presets::compile_card

pub fn compile_card(source: &model::GraphSource, resource_types: &std::collections::BTreeMap<model::Symbol, model::ValueType>) -> Result<std::sync::Arc<compiler::Plan>, PresetError>

Compiles the card graph against the resource types of a theme instance.

The environment carries the theme's own declared resource types, so the graph binds exactly the names the theme defines. The catalog is the existing built-in catalog; this preset registers no kernel.

fnaster_blueprint::presets::default_theme

pub fn default_theme() -> Result<theme::Theme, PresetError>

The default, versioned theme vocabulary.

The theme is a plain [Theme] over the existing resource dictionary. It declares typed Srgb8 colors, one alias and the logical spacing and font size literals. It is not a new dictionary type, a host resource authority or an application-wide singleton.

Constants

constaster_blueprint::presets::ACCENT

pub const ACCENT: &str

Accent color of the default vocabulary.

constaster_blueprint::presets::BUTTON_FILL

pub const BUTTON_FILL: &str

Alias of [CARD_FILL] in the default vocabulary.

constaster_blueprint::presets::CARD_FILL

pub const CARD_FILL: &str

Card surface color of the default vocabulary.

constaster_blueprint::presets::DEFAULT_THEME_NAME

pub const DEFAULT_THEME_NAME: &str

Versioned name of the default theme vocabulary.

constaster_blueprint::presets::DEFAULT_THEME_VERSION

pub const DEFAULT_THEME_VERSION: u32

Version of the default theme vocabulary.

constaster_blueprint::presets::FONT_SIZE

pub const FONT_SIZE: &str

Logical font size.

constaster_blueprint::presets::MIX_NODE

pub const MIX_NODE: u64

Node key of the color mix node.

constaster_blueprint::presets::OUTPUT_BOUNDS

pub const OUTPUT_BOUNDS: &str

Output of the card rect, LogicalRect.

constaster_blueprint::presets::OUTPUT_FILL

pub const OUTPUT_FILL: &str

Output of the card color, Srgb8.

constaster_blueprint::presets::PARAM_ACCENT_MIX

pub const PARAM_ACCENT_MIX: &str

Mixing weight between [CARD_FILL] and [ACCENT].

constaster_blueprint::presets::PARAM_HEIGHT

pub const PARAM_HEIGHT: &str

Height of the card, in logical units.

constaster_blueprint::presets::PARAM_WIDTH

pub const PARAM_WIDTH: &str

Width of the card, in logical units.

constaster_blueprint::presets::PARAM_X

pub const PARAM_X: &str

Left edge of the card, in logical units.

constaster_blueprint::presets::PARAM_Y

pub const PARAM_Y: &str

Top edge of the card, in logical units.

constaster_blueprint::presets::RECT_NODE

pub const RECT_NODE: u64

Node key of the rect node. It is also the key of the card visual.

constaster_blueprint::presets::SPACE_LG

pub const SPACE_LG: &str

Large logical spacing step.

constaster_blueprint::presets::SPACE_MD

pub const SPACE_MD: &str

Medium logical spacing step.

constaster_blueprint::presets::SPACE_SM

pub const SPACE_SM: &str

Small logical spacing step.

constaster_blueprint::presets::TEXT

pub const TEXT: &str

Text color of the default vocabulary.