API reference

aster_blueprint::material_theme

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 named default material dictionary over the existing seams.

This module authors exactly one reusable thing: a bounded, named aster.materials.v1 vocabulary that binds the three material surfaces (ui.material.inside, ui.material.outline, ui.material.outside) to caller-owned prepared handles. It reuses the existing theme layer ([Theme], ThemeInstance), the existing typed resource dictionary ([ResourceEntry]), the existing prepared-handle seam ([PreparedHandle], [SurfaceHandle]) and the existing bounded [ResourceArena]. It adds no kernel, no registry, no resource id, no wire protocol and no painter: every value it produces is a value the current code already computes.

The vocabulary is deliberately small and it is not a widget library and not a complete default theme. It defines material bindings only: no layout, no typography, no motion and no stock visual blueprint. The host still owns presentation; nothing here proves a renderer can present these surfaces.

[DefaultMaterialTheme] is caller-created and owns

  • one [ResourceArena] whose default has two paint slots and zero retained recording commands (with_limits admits explicit extra storage),
  • exactly two retained paints (the inside and outline solids), and
  • one caller-owned handle map that binds the surface and paint names to those existing handles.

The base [Theme] is built by this value and exposed as a borrowed Arc<Theme>, so callers can share it with independent ThemeInstances. The arena and the handle map are exposed both immutably and explicitly mutably. There is no hidden refresh, no cache and no lifetime extension: a caller which removes or reuses an arena slot invalidates the old handles itself, and the next admission refuses the stale handle.

(documentation continues in the source)

Structs

structaster_blueprint::material_theme::DefaultMaterialTheme

pub struct DefaultMaterialTheme { /* see fields */ }

Caller-owned default material vocabulary and its explicit resource storage.

Methods

  • fn new(palette: MaterialPalette) -> Result<Self, MaterialThemeError> — Builds the aster.materials.v1 vocabulary and binds its handles.
  • fn with_limits(palette: MaterialPalette, slots: usize, commands: usize) -> Result<Self, MaterialThemeError> — Explicit storage limits for callers adding custom material overrides. Two slots are used by the default paints. Recording overrides consume additional caller-admitted slots and their actual command budget. Original arena/allocation/identity and theme refusals remain typed.
  • fn base(&self) -> &Arc<Theme> — The owned base theme, shared as a borrowed Arc.
  • fn arena(&self) -> &ResourceArena — The owned arena, borrowed.
  • fn handles(&self) -> &BTreeMap<Symbol, PreparedHandle> — The caller-owned handle map, borrowed.
  • fn arena_mut(&mut self) -> &mut ResourceArena — Explicit caller-owned mutable arena access, with no hidden refresh.
  • fn handles_mut(&mut self) -> &mut BTreeMap<Symbol, PreparedHandle> — Explicit caller-owned mutable handle-map access.
  • fn inside_paint(&self) -> PaintHandle — The initially issued inside paint handle; explicit mutation may retire it.
  • fn outline_paint(&self) -> PaintHandle — The initially issued outline paint handle; explicit mutation may retire it.

structaster_blueprint::material_theme::MaterialPalette

pub struct MaterialPalette { /* see fields */ }

Caller-supplied solid colors for the two material paints.

These two fields are the only color inputs to [DefaultMaterialTheme::new]; the constructor holds no third, hidden palette. [Default] documents the neutral starting colors: an opaque neutral blue inside and an opaque neutral gray outline. Both are explicit byte sRGB, never an untagged linear color.

Public fields

fieldtype
insideaster_ui::Srgb8Solid color of the inside material.
outlineaster_ui::Srgb8Solid color of the outline material.

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

Enums

enumaster_blueprint::material_theme::MaterialThemeError

pub enum MaterialThemeError { Resource, Asset }

Preserves the original arena or authored-theme construction refusal.

Variants

  • Resource
  • Asset

Trait implementations: Debug, Display, Error, From<AssetError>, From<ResourceError>

Constants

constaster_blueprint::material_theme::BUTTON_INSIDE

pub const BUTTON_INSIDE: &str

ui.button.inside alias of [MATERIAL_INSIDE].

constaster_blueprint::material_theme::BUTTON_OUTLINE

pub const BUTTON_OUTLINE: &str

ui.button.outline alias of [MATERIAL_OUTLINE].

constaster_blueprint::material_theme::BUTTON_OUTSIDE

pub const BUTTON_OUTSIDE: &str

ui.button.outside alias of [MATERIAL_OUTSIDE].

constaster_blueprint::material_theme::CARD_INSIDE

pub const CARD_INSIDE: &str

ui.card.inside alias of [MATERIAL_INSIDE].

constaster_blueprint::material_theme::CARD_MATERIAL

pub const CARD_MATERIAL: &str

Host paint binding used by the existing stock card (ui.card.material).

constaster_blueprint::material_theme::CARD_OUTLINE

pub const CARD_OUTLINE: &str

ui.card.outline alias of [MATERIAL_OUTLINE].

constaster_blueprint::material_theme::CARD_OUTSIDE

pub const CARD_OUTSIDE: &str

ui.card.outside alias of [MATERIAL_OUTSIDE].

constaster_blueprint::material_theme::COMMAND_BUDGET

pub const COMMAND_BUDGET: usize

Default retained recording-command budget of the owned arena.

constaster_blueprint::material_theme::MATERIAL_INSIDE

pub const MATERIAL_INSIDE: &str

Inside material surface binding (ui.material.inside).

constaster_blueprint::material_theme::MATERIAL_OUTLINE

pub const MATERIAL_OUTLINE: &str

Outline material surface binding (ui.material.outline).

constaster_blueprint::material_theme::MATERIAL_OUTSIDE

pub const MATERIAL_OUTSIDE: &str

Outside material surface binding (ui.material.outside), explicitly empty.

constaster_blueprint::material_theme::MATERIAL_THEME_NAME

pub const MATERIAL_THEME_NAME: &str

Versioned name of the default material vocabulary.

constaster_blueprint::material_theme::MATERIAL_THEME_VERSION

pub const MATERIAL_THEME_VERSION: u32

Version of the default material vocabulary.

constaster_blueprint::material_theme::PAINT_SLOTS

pub const PAINT_SLOTS: usize

Default paint-slot capacity of the owned arena.