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.
Small reusable application controls built on the existing scene, input and presentation contracts.
This module adds no painter, no router, no snapshot system, no clock and no backend authority. A control owns measured geometry, its interaction policy and its deliberate activation state. The caller owns identity, appearance, fonts, materials, time, and the backend that authorizes, persists and confirms.
Nothing here claims a visible picture. A control prepares a candidate
picture into the scene. That picture becomes visible only when the
application commits the edit, renders the scene, stages that exact frame
and acknowledges that exact receipt through
[crate::app::Presentation::acknowledge].
Structs
structaster_ui::component::ActionHandle
pub struct ActionHandle { /* see fields */ }A retained action of the panel: the real control and its real identity.
Methods
fn key(&self) -> ModelKey— The stable model identity the caller assigned to the action.fn node(&self) -> NodeId— The node of the action: the target of the acknowledged routing and the node the caller binds its action to.fn title_node(&self) -> NodeId— The node of the retained text of the action.fn policy(&self) -> Interaction— The interaction policy the action publishes with the frame.fn is_enabled(&self) -> bool— True while the action accepts a deliberate activation.fn is_busy(&self) -> bool— True while a request for this action is pending.fn natural_size(&self) -> LayoutSize— The measured size of the action.fn button(&self) -> &Button— The composed button control.fn description<'a>(&self, name: &'a str, focused: bool) -> Description<'a>— The semantic description of the action.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::Button
pub struct Button { /* see fields */ }A button inserted into a scene.
Methods
fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ButtonSpec, skin: &ButtonSkin) -> Result<Button, Error>— Inserts a button with its surface and label children.fn node(&self) -> NodeId— The root node that carries the identity and the interaction policy.fn key(&self) -> ModelKey— The caller-supplied stable model identity.fn size(&self) -> LayoutSize— The measured button size.fn minimum_width(&self) -> f64— The smallest width this button may occupy.fn current_size(&self) -> LayoutSize— The button's current size: the measured size with the current width and height.fn set_width(&mut self, edit: &mut Edit<'_>, origin: [f64; 2], width: f64) -> Result<bool, Error>— Sets the button's width, in logical pixels.fn set_size(&mut self, edit: &mut Edit<'_>, origin: [f64; 2], width: f64, height: f64) -> Result<bool, Error>— Sets the button's size, in logical pixels.fn set_label(&mut self, edit: &mut Edit<'_>, label: &Label, padding: [f64; 4], origin: [f64; 2], size: LayoutSize) -> Result<bool, Error>— Replaces the caller's prepared label and applies its arranged bounds.fn policy(&self) -> Interaction— The interaction policy for this button.fn set_focus_order(&mut self, focus_order: Option<u32>)— Sets the button's tab rank.fn focus_order(&self) -> Option<u32>— The button's current tab rank.fn prepare(&self, edit: &mut Edit<'_>, skin: &ButtonSkin, state: ControlState) -> Result<bool, Error>— Prepares the surface picture for a state.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::ButtonInput
pub struct ButtonInput<A> { /* see fields */ }Deliberate activation state for one button.
Activation requires a deliberate pairing: a primary pointer press and
release on this button, or an Enter/Space press and release while this
button holds focus. The pairing is bound to the exact acknowledged
snapshot and geometry through
[crate::app::Presentation::bind_action] and is revalidated with
[crate::app::Presentation::validate_action] before the action is
returned, so a stale release after a snapshot or geometry change is
refused instead of applied.
The disabled and busy flags are owned here, and they are the same flags
that refuse activation and that [ButtonInput::picture_state] reads, so
the picture cannot drift from the refusal. The application's snapshot and
the backend controller stay outside this type: the application maps its
own request phase onto [ButtonInput::set_busy].
Methods
fn new(button: &Button) -> Self— Creates the activation state of a button.fn bind<C: ControlContext>(&self, context: &C, value: A) -> Result<BoundAction<A>, ActivationError>— Explicit programmatic binding.fn pointer_down<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer, value: A) -> Result<(), ActivationError>— Records a deliberate primary pointer press on this button.fn pointer_up<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer) -> Result<BoundAction<A>, ActivationError>— Completes a deliberate primary pointer release on this button.fn key_down<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey, value: A) -> Result<(), ActivationError>— Records a deliberate activation key press on this button.fn key_up<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey) -> Result<BoundAction<A>, ActivationError>— Completes a deliberate activation key release on this button.fn cancel(&mut self)— Drops any pending deliberate activation.fn state(&self) -> ButtonState— The current deliberate input state.fn set_enabled(&mut self, enabled: bool)— Marks the control disabled. A disabled control refuses activation and is drawn as disabled. Disabling cancels any held gesture; enabling again requires a fresh press. This does not cancel an application request.fn set_busy(&mut self, busy: bool)— Marks the control busy. A busy control refuses activation and is drawn as busy. Becoming busy cancels any held gesture; clearing busy requires a fresh press. This does not cancel an application request.fn is_enabled(&self) -> bool— True while the control accepts activation.fn is_busy(&self) -> bool— True while the control refuses activation because a request is pending.fn picture_state(&self, focused: bool, hovered: bool) -> ControlState— The surface state implied by this control's own state and the caller's focus and hover observations.
structaster_ui::component::ButtonSkin
pub struct ButtonSkin { /* see fields */ }Caller-provided visual tokens for a button.
Public fields
| field | type | |
|---|---|---|
radius | f64 | Corner radius in logical pixels. |
idle | Surface | The idle surface. |
hover | Surface | The hovered surface. |
focus | Surface | The focused surface. |
pressed | Surface | The pressed surface. |
disabled | Surface | The disabled surface. |
busy | Surface | The busy surface. |
Trait implementations: Clone, Debug
structaster_ui::component::ButtonSpec
pub struct ButtonSpec { /* see fields */ }The caller-owned identity, measured content and metrics of a button.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this button. |
label | super::label::Label | The measured label content. |
padding | [f64; 4] | Caller-provided padding in logical pixels: left, top, right, bottom. |
focus_order | Option<u32> | The tab rank of this button, when it takes focus. |
Trait implementations: Clone, Debug
structaster_ui::component::Card
pub struct Card { /* see fields */ }A card inserted into a scene.
Methods
fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &CardSpec, skin: &CardSkin, budget: CardBudget) -> Result<Card, CardError>— Inserts a card with its surface, heading and content children.fn node(&self) -> NodeId— The root node that carries the identity and the box.fn surface_node(&self) -> NodeId— The node that carries the caller's surface.fn heading_node(&self) -> Option<NodeId>— The node that carries the measured heading, if the card has one.fn content_node(&self) -> Option<NodeId>— The node that carries the measured content, if the card has any.fn key(&self) -> ModelKey— The caller-supplied stable model identity.fn size(&self) -> LayoutSize— The measured size of the card.fn node_count(&self) -> usize— The exact number of scene nodes this card holds.fn prepare(&self, edit: &mut Edit<'_>, skin: &CardSkin) -> Result<bool, Error>— Prepares the surface picture of the card.fn semantic_description<'a>(&self, name: &'a str) -> Description<'a>— The semantic description of this card.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::CardBudget
pub struct CardBudget { /* see fields */ }The space, the node admission and the output scale the card must fit.
A card refuses before it touches the edit when it does not fit. It never wraps, truncates, clips or shrinks its measured content to make room.
Public fields
| field | type | |
|---|---|---|
available | LayoutSize | The size the card may occupy in its parent, in logical pixels. |
used_nodes | usize | The nodes the scene already holds, as the caller counted them. |
node_capacity | usize | The nodes the presentation admits in total. |
output_scale | f64 | The exact output scale of the frame the card's content is prepared for. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::CardSkin
pub struct CardSkin { /* see fields */ }The caller-owned appearance of a card.
Public fields
| field | type | |
|---|---|---|
radius | f64 | Corner radius in logical pixels. |
surface | super::button::Surface | The surface behind the card's content. |
Trait implementations: Clone, Debug
structaster_ui::component::CardSpec
pub struct CardSpec { /* see fields */ }The caller-owned identity, measured content and metrics of a card.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this card. |
heading | Option<super::label::Label> | The measured heading of the card, if the card has one. |
content | Option<super::label::Label> | The measured content of the card, if the card has any. |
padding | [f64; 4] | Caller-provided padding in logical pixels: left, top, right, bottom. |
gap | f64 | The gap between the heading and the content, in logical pixels. |
Methods
fn node_count(&self) -> usize— The exact number of scene nodes a card with this spec inserts.fn require_scale(&self, output_scale: f64) -> Result<(), Error>— Refuses a label that was prepared for a different output scale.
Trait implementations: Clone, Debug
structaster_ui::component::DetailHandle
pub struct DetailHandle { /* see fields */ }A retained detail of the panel: the real card and its real identity.
Methods
fn key(&self) -> ModelKey— The stable model identity the caller assigned to the detail.fn node(&self) -> NodeId— The node of the detail.fn surface_node(&self) -> NodeId— The node of the detail's surface.fn heading_node(&self) -> Option<NodeId>— The node of the retained heading of the detail.fn content_node(&self) -> Option<NodeId>— The node of the retained content of the detail.fn natural_size(&self) -> LayoutSize— The measured size of the detail.fn card(&self) -> &Card— The composed card control.fn description<'a>(&self, name: &'a str) -> Description<'a>— The semantic description of the detail.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::EntryHandle
pub struct EntryHandle { /* see fields */ }A retained entry of the panel: the real control and its real identity.
Methods
fn key(&self) -> ModelKey— The stable model identity the caller assigned to the entry.fn node(&self) -> NodeId— The node of the entry: the target of the acknowledged routing and the node the caller binds its action to.fn title_node(&self) -> NodeId— The node of the retained text of the entry.fn policy(&self) -> Interaction— The interaction policy the entry publishes with the frame.fn state(&self) -> RowState— The entry's own state.fn role(&self) -> EntryRole— The semantic role the caller gave the entry.fn natural_size(&self) -> LayoutSize— The measured size of the entry, without the column's stretch.fn row(&self) -> &ListRow— The composed row control.fn description<'a>(&self, name: &'a str, focused: bool) -> Description<'a>— The semantic description of the entry.
Trait implementations: Clone, Debug
structaster_ui::component::Label
pub struct Label { /* see fields */ }Painted label content and its measured dimensions in logical pixels.
Methods
fn new(content: Arc<Recording>, advance: f64, height: f64) -> Result<Self, Error>— Builds a label from caller-provided content and measured dimensions.fn with_prepared_scale(self, output_scale: f64) -> Result<Self, Error>— Declares the output scale the content was prepared for (the scale of the glyph drawings the content records), so a frame at another scale refuses it (require_scale) instead of drawing it blurred.fn content(&self) -> &Arc<Recording>— The caller-provided painted content.fn advance(&self) -> f64— The measured horizontal advance in logical pixels.fn height(&self) -> f64— The measured line height in logical pixels.fn size(&self) -> LayoutSize— The measured content size.fn prepared_scale(&self) -> Option<f64>— The output scale the content was prepared for.fn require_scale(&self, output_scale: f64) -> Result<(), Error>— Refuses a label prepared for a different output scale.
Trait implementations: Clone, Debug
structaster_ui::component::ListRow
pub struct ListRow { /* see fields */ }An interactive list row.
Methods
const NODE_COUNT: usize— The scene nodes a row costs: the composed button's root, its surface and its title label, plus the optional marker.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &RowSpec, skin: &ButtonSkin) -> Result<ListRow, Error>— Inserts the row: the composed button plus the optional marker.fn button(&self) -> &Button— The composed button. Its root carries the caller's model key and the interaction policy, and its activation is driven byRowInput.fn node(&self) -> NodeId— The root node of the row. The whole row is the target.fn key(&self) -> ModelKey— The caller-supplied stable model identity.fn policy(&self) -> Interaction— The interaction policy for this row.fn set_focus_order(&mut self, focus_order: Option<u32>)— Sets the row's tab rank.fn focus_order(&self) -> Option<u32>— The row's current tab rank.fn marker(&self) -> Option<RowMarker>— The row's current marker, if it has one.fn set_marker(&mut self, edit: &mut Edit<'_>, marker: Option<RowMarker>) -> Result<bool, Error>— Sets the row's selection marker.fn set_label(&mut self, edit: &mut Edit<'_>, label: &Label, padding: [f64; 4], origin: [f64; 2], size: LayoutSize) -> Result<bool, Error>— Replaces the row's caption with a caller-prepared label.fn size(&self) -> LayoutSize— The measured row size. It never changes with the state.fn minimum_width(&self) -> f64— The smallest width this row may occupy.fn current_size(&self) -> LayoutSize— The row's current size: the measured size with the current width and height.fn set_width(&mut self, edit: &mut Edit<'_>, origin: [f64; 2], width: f64) -> Result<bool, Error>— Sets the row's width, in logical pixels.fn set_size(&mut self, edit: &mut Edit<'_>, origin: [f64; 2], width: f64, height: f64) -> Result<bool, Error>— Sets the row's size, in logical pixels.fn fit(&self, available: f64) -> RowFit— The measured fit of this row's title in an available width.fn prepare(&self, edit: &mut Edit<'_>, skin: &ButtonSkin, visual: RowVisual) -> Result<bool, Error>— Prepares the surface and the marker for a picture.fn description<'a>(&self, name: &'a str, state: RowState, focused: bool) -> Description<'a>— The semantic description of the row for a state.
Trait implementations: Clone, Debug
structaster_ui::component::Menu
pub struct Menu { /* see fields */ }A measured popup menu: the popup's own nodes and its measured items.
Methods
fn required_nodes(items: usize, markers: usize) -> usize— The scene nodes a menu costs: the popup root, the popup surface, three nodes per item and one more per item that carries a marker.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &MenuSpec, skin: &MenuSkin) -> Result<Menu, MenuError>— Inserts the popup and its measured items.fn node(&self) -> NodeId— The popup's root node: it carries the popup identity and the pointer policy of the popup background.fn surface_node(&self) -> NodeId— The popup's background surface node.fn key(&self) -> ModelKey— The caller's stable model identity of the popup.fn size(&self) -> LayoutSize— The measured size of the popup.fn origin(&self) -> [f64; 2]— The placement of the popup's top-left corner.fn content_width(&self) -> f64— The measured width of the item column.fn len(&self) -> usize— The number of items.fn is_empty(&self) -> bool— True when the menu has no items.fn row(&self, index: usize) -> Option<&ListRow>— The row of one item.fn item_key(&self, index: usize) -> Option<ModelKey>— The stable model identity of one item.fn index_of(&self, key: ModelKey) -> Option<usize>— The index of the item with this stable model identity.fn policies(&self) -> Vec<Interaction>— The interaction policies the popup publishes with the frame.fn prepare(&self, edit: &mut Edit<'_>, skin: &MenuSkin, visuals: &[RowVisual]) -> Result<bool, MenuError>— Prepares the popup surface and every item's picture.fn description<'a>(&self, name: &'a str) -> Description<'a>— The semantic description of the popup.
Trait implementations: Clone, Debug
structaster_ui::component::MenuController
pub struct MenuController<A> { /* see fields */ }The menu's controller: the item states, the selection and the deliberate activation over the menu's rows.
The controller owns no open state: the application owns it and simply stops sending events to a closed menu. The controller owns the item states only as the mirror of the application's confirmed states, and it owns the selection, which it reports to the application instead of moving the focus itself.
Methods
fn new(menu: &Menu) -> Self— Creates the controller of a measured menu.fn menu(&self) -> &Menu— The measured menu this controller drives.fn len(&self) -> usize— The number of items.fn is_empty(&self) -> bool— True when the menu has no items.fn item_key(&self, index: usize) -> Option<ModelKey>— The stable model identity of one item.fn index_of(&self, key: ModelKey) -> Option<usize>— The index of the item with this stable model identity.fn state(&self, index: usize) -> Option<RowState>— The authoritative state of one item.fn set_state(&mut self, index: usize, state: RowState) -> Result<(), MenuError>— Sets the state of one item, from the application's confirmed model.fn selection(&self) -> Option<usize>— The menu's own selection.fn eligible(&self, index: usize) -> bool— True when the item may be selected and activated.fn select(&mut self, index: usize) -> Result<usize, MenuError>— Selects one item.fn select_next(&mut self) -> Option<usize>— Moves the selection to the next eligible item, wrapping around.fn select_previous(&mut self) -> Option<usize>— Moves the selection to the previous eligible item, wrapping around.fn visuals(&self, focused: Option<usize>, hovered: Option<usize>) -> Vec<RowVisual>— The picture of every item.fn pointer_down<C: MenuContext>(&mut self, context: &C, routed: &RoutedPointer, value: A) -> Result<MenuOutcome<A>, MenuError>— Records a deliberate primary pointer press.fn pointer_up<C: MenuContext>(&mut self, context: &C, routed: &RoutedPointer) -> Result<MenuOutcome<A>, MenuError>— Completes a deliberate primary pointer release.fn key_down<C: MenuContext>(&mut self, context: &C, routed: &RoutedKey, value: A) -> Result<MenuOutcome<A>, MenuError>— Records a key event.fn key_up<C: MenuContext>(&mut self, context: &C, routed: &RoutedKey) -> Result<MenuOutcome<A>, MenuError>— Completes a deliberate activation key release.fn cancel(&mut self)— Drops every pending deliberate activation.
structaster_ui::component::MenuItemSpec
pub struct MenuItemSpec { /* see fields */ }One measured menu item.
The item is a row: the caller's stable model identity, the caller's measured label, the caller's padding, the caller's optional selection marker and the caller's tab rank. The menu chooses no font, no material and no text.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity of this item. The application keeps this identity across the item's whole life; the menu never invents one. |
label | component::label::Label | The measured label of the item. |
padding | [f64; 4] | The item padding in logical pixels: left, top, right, bottom. |
focus_order | Option<u32> | The tab rank of the item, when it takes focus. |
marker | Option<component::list_row::RowMarker> | The caller's selection marker, drawn for the selected item. |
state | component::list_row::RowState | The initial state of the item. |
Trait implementations: Clone, Debug
structaster_ui::component::MenuMetrics
pub struct MenuMetrics { /* see fields */ }The measured metrics of a popup menu.
Public fields
| field | type | |
|---|---|---|
item_gap | f64 | The vertical gap between two items, in logical pixels. |
padding | [f64; 4] | The popup padding in logical pixels: left, top, right, bottom. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::MenuSkin
pub struct MenuSkin { /* see fields */ }The caller's appearance of a popup menu.
The item skin is the caller's own button skin, reused verbatim: the menu adds no material, no palette and no radius of its own.
Public fields
| field | type | |
|---|---|---|
surface | component::button::Surface | The popup's background surface. |
items | component::button::ButtonSkin | The caller's item skin. |
Trait implementations: Clone, Debug
structaster_ui::component::MenuSpec
pub struct MenuSpec { /* see fields */ }The caller-owned identity, items and metrics of a popup menu.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity of the popup itself. |
items | Vec<MenuItemSpec> | The measured items, in display order. |
metrics | MenuMetrics | The measured metrics of the popup. |
origin | [f64; 2] | The placement of the popup's top-left corner, in the parent's space. |
viewport | LogicalRect | The space the popup may occupy, in the parent's space. |
Trait implementations: Clone, Debug
structaster_ui::component::Progress
pub struct Progress { /* see fields */ }A progress control inserted into a scene.
The three node identities are stable: an update reuses them and never inserts a node, so the scene keeps its own node identities across the whole life of the control.
Methods
fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ProgressSpec, skin: &ProgressSkin, budget: ProgressBudget) -> Result<Progress, ProgressError>— Inserts a progress control with its track and fill children.fn root(&self) -> NodeId— The root node that carries the identity and the box.fn track_node(&self) -> NodeId— The node that carries the caller's track.fn fill_node(&self) -> NodeId— The node that carries the fill.fn key(&self) -> ModelKey— The caller-supplied stable model identity.fn size(&self) -> LayoutSize— The measured size of the control.fn orientation(&self) -> ProgressOrientation— The direction the fill advances in.fn value(&self) -> ProgressValue— The value the control currently shows.fn layout(&self) -> ProgressLayout— The measured layout of the control.fn node_count(&self) -> usize— The exact number of scene nodes this control holds.fn command_count(&self) -> usize— The exact number of recording commands this control contributes.fn set_value(&mut self, edit: &mut Edit<'_>, value: ProgressValue) -> Result<bool, Error>— Applies a new caller value to the existing fill node.fn set_extent(&mut self, edit: &mut Edit<'_>, width: f64, height: f64) -> Result<bool, Error>— Applies a new caller extent to the existing nodes.fn prepare(&self, edit: &mut Edit<'_>, skin: &ProgressSkin) -> Result<bool, Error>— Prepares the track and the fill pictures of the control.fn semantic_description<'a>(&self, name: &'a str) -> Description<'a>— The semantic description of this control.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::ProgressBudget
pub struct ProgressBudget { /* see fields */ }The space and the node admission the progress control must fit.
A progress control refuses before it touches the edit when it does not fit. It never wraps, truncates, clips or shrinks itself to make room.
Public fields
| field | type | |
|---|---|---|
available | LayoutSize | The size the control may occupy in its parent, in logical pixels. |
used_nodes | usize | The nodes the scene already holds, as the caller counted them. |
node_capacity | usize | The nodes the presentation admits in total. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::ProgressLayout
pub struct ProgressLayout { /* see fields */ }The measured geometry of a progress control.
The layout is derived from the caller's spec once and then carried by the control. Every bound is exact: the layout never rounds a fraction and never rounds a pixel.
Methods
fn measure(spec: &ProgressSpec) -> Result<Self, ProgressError>— Measures the layout of the caller's spec.fn size(&self) -> LayoutSize— The measured size of the control, in logical pixels.fn orientation(&self) -> ProgressOrientation— The direction the fill advances in.fn value(&self) -> ProgressValue— The value the layout was measured for.fn track_bounds(&self) -> LogicalRect— The bounds of the track: the whole extent of the control.fn fill_bounds(&self) -> LogicalRect— The bounds of the fill for the current value.fn with_value(&self, value: ProgressValue) -> Result<Self, ProgressError>— The layout of the same extent with a new caller value.fn with_extent(&self, width: f64, height: f64) -> Result<Self, ProgressError>— The layout of the same value with a new caller extent.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::ProgressSkin
pub struct ProgressSkin { /* see fields */ }The caller-owned appearance of a progress control.
Public fields
| field | type | |
|---|---|---|
radius | f64 | The corner radius of the track and of the fill, in logical pixels. |
track | super::button::Surface | The caller's surface behind the fill. |
fill | super::button::Surface | The caller's surface of the fill itself. |
Trait implementations: Clone, Debug
structaster_ui::component::ProgressSpec
pub struct ProgressSpec { /* see fields */ }The caller-owned identity, value and extent of a progress control.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this control. |
value | ProgressValue | The caller's value: a determinate fraction or an indeterminate phase. |
width | f64 | The logical width of the control, in logical pixels. |
height | f64 | The logical height of the control, in logical pixels. |
Methods
fn node_count(&self) -> usize— The exact number of scene nodes a progress control with this spec inserts.fn layout(&self) -> Result<ProgressLayout, ProgressError>— The measured layout of the caller's spec.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::Recipe
pub struct Recipe { /* see fields */ }A retained panel: the composed controls and their measured layout.
Methods
const MAX_ENTRIES: usize— The default number of entries one panel holds.const MAX_ACTIONS: usize— The default number of actions one panel holds.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &RecipeSpec, skin: &RecipeSkin, budget: &RecipeBudget) -> Result<Recipe, RecipeError>— Inserts the panel: the root, the two columns, the entries, the detail and the actions.fn node(&self) -> NodeId— The root node of the panel.fn list_node(&self) -> NodeId— The list column of the panel: the caller's entries live under it.fn detail_column_node(&self) -> NodeId— The detail column of the panel: the detail and the actions live under it.fn action_row_node(&self) -> Option<NodeId>— The action row of the panel, if the panel has actions.fn entries(&self) -> &[EntryHandle]— The retained entries of the panel, in the panel's own order.fn entry(&self, key: ModelKey) -> Option<&EntryHandle>— The retained entry of the given model identity.fn actions(&self) -> &[ActionHandle]— The retained actions of the panel, in the panel's own order.fn action(&self, key: ModelKey) -> Option<&ActionHandle>— The retained action of the given model identity.fn detail(&self) -> Option<&DetailHandle>— The retained detail of the panel.fn interactions(&self) -> &[Interaction]— The interactions the panel publishes with the frame.fn plan(&self, spec: &RecipeSpec) -> Result<RecipePlan, RecipeError>— The candidate plan of a new plan of the panel.fn plan_at_scale(&self, spec: &RecipeSpec, scale: f64) -> Result<RecipePlan, RecipeError>— The candidate plan of a new plan at an explicit output scale.fn fit(&self, viewport: LayoutSize) -> Result<ShellFit, RecipeError>— The measured fit of the panel's current state in a viewport.fn fit_plan(&self, plan: &RecipePlan, viewport: LayoutSize) -> Result<ShellFit, RecipeError>— The measured fit of a candidate plan in a viewport.fn apply(&self, edit: &mut Edit<'_>, plan: &RecipePlan, viewport: LayoutSize, skin: &RecipeSkin, measure: &mut impl FnMut(NodeId, LayoutConstraints) -> Result<LayoutSize, Error>) -> Result<RecipeApplied, RecipeError>— Writes a candidate plan into the caller's edit and arranges it.fn arrange(&self, edit: &mut Edit<'_>, viewport: LayoutSize, measure: &mut impl FnMut(NodeId, LayoutConstraints) -> Result<LayoutSize, Error>) -> Result<RecipeApplied, RecipeError>— Arranges the panel's current state in a viewport.fn adopt(&mut self, applied: RecipeApplied) -> Result<(), RecipeError>— Installs an applied panel after the caller committed its edit.
Trait implementations: Clone, Debug
structaster_ui::component::RecipeAction
pub struct RecipeAction { /* see fields */ }The caller's own plan for one action of the panel.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this action. |
label | super::label::Label | The measured label of the action. |
enabled | bool | True while the action accepts a deliberate activation. |
busy | bool | True while a request for this action is pending. |
focus_order | Option<u32> | The tab rank of the action, when it takes focus. |
padding | [f64; 4] | The padding of the action in logical pixels: left, top, right, bottom. |
Trait implementations: Clone, Debug
structaster_ui::component::RecipeApplied
pub struct RecipeApplied { /* see fields */ }The applied state of a panel: the retained controls and their measurements, ready to be adopted once the edit was committed.
Methods
fn fit(&self) -> ShellFit— The measured fit of the applied panel.fn interactions(&self) -> &[Interaction]— The interactions the applied panel publishes with the frame.
Trait implementations: Clone, Debug
structaster_ui::component::RecipeBudget
pub struct RecipeBudget { /* see fields */ }The space, the node admission and the output scale the panel must fit.
Public fields
| field | type | |
|---|---|---|
used_nodes | usize | The nodes the scene already holds, as the caller counted them. |
node_capacity | usize | The nodes the presentation admits in total. |
output_scale | f64 | The exact output scale of the frame the content is prepared for. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::RecipeDetail
pub struct RecipeDetail { /* see fields */ }The caller's own plan for the panel's detail.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to the detail. |
heading | Option<super::label::Label> | The measured heading of the detail, if it has one. |
content | Option<super::label::Label> | The measured content of the detail, if it has any. |
padding | [f64; 4] | The padding of the detail in logical pixels: left, top, right, bottom. |
gap | f64 | The gap between the heading and the content, in logical pixels. |
Trait implementations: Clone, Debug
structaster_ui::component::RecipeEntry
pub struct RecipeEntry { /* see fields */ }The caller's own plan for one entry of the panel's list.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this entry. |
title | super::label::Label | The measured title. The caller measures it with the real font; the recipe never derives, rounds or truncates it. |
state | super::list_row::RowState | The entry's own state: idle, selected, loading, disabled or busy. |
marker | Option<super::list_row::RowMarker> | The caller's optional selection marker. |
focus_order | Option<u32> | The tab rank of the entry, when it takes focus. |
role | EntryRole | The semantic role the caller gives the entry. |
padding | [f64; 4] | The padding of the entry in logical pixels: left, top, right, bottom. |
Trait implementations: Clone, Debug
structaster_ui::component::RecipePlan
pub struct RecipePlan { /* see fields */ }A candidate plan of a panel: the measured result of a new plan.
The plan is pure. It touches no scene and no edit, so the caller can ask for the fit of a plan before it writes anything.
Methods
fn entry_count(&self) -> usize— The number of entries of the plan.fn action_count(&self) -> usize— The number of actions of the plan.fn removed_entries(&self) -> &[ModelKey]— The model identities of the entries the plan drops.fn removed_actions(&self) -> &[ModelKey]— The model identities of the actions the plan drops.
Trait implementations: Clone, Debug
structaster_ui::component::RecipeSkin
pub struct RecipeSkin { /* see fields */ }The caller's own appearance of a panel.
Public fields
| field | type | |
|---|---|---|
row | super::button::ButtonSkin | The skin of the list entries. |
card | super::card::CardSkin | The skin of the detail card. |
action | super::button::ButtonSkin | The skin of the actions. |
Trait implementations: Clone, Debug
structaster_ui::component::RecipeSpec
pub struct RecipeSpec { /* see fields */ }The caller's own plan of a panel.
Public fields
| field | type | |
|---|---|---|
shell | super::shell::ShellSpec | The measured shell metrics of the panel: its padding, the gap between the columns and the breakpoint between the two layouts. |
row_gap | f64 | The gap between the entries of the list and between the detail and the action row, in logical pixels. |
action_gap | f64 | The gap between the actions inside the action row, in logical pixels. |
entries | Vec<RecipeEntry> | The entries of the list, in the caller's own order. |
detail | Option<RecipeDetail> | The detail of the panel, if it has one. |
actions | Vec<RecipeAction> | The actions of the panel, in the caller's own order. |
Trait implementations: Clone, Debug
structaster_ui::component::RowInput
pub struct RowInput<A> { /* see fields */ }The authoritative activation state of a row.
The row's state drives the activation gate, so a row that looks disabled or busy cannot activate: the consumer never has to set a second flag.
Methods
fn new(row: &ListRow) -> Self— Creates the activation state of a row.fn state(&self) -> RowState— The row's authoritative state.fn set_state(&mut self, state: RowState)— Sets the row's state. The activation gate follows it immediately.fn visual(&self, focused: bool, hovered: bool) -> RowVisual— The picture the row prepares for the current state.fn pointer_down<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer, value: A) -> Result<(), ActivationError>— Records a deliberate primary pointer press.fn pointer_up<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer) -> Result<BoundAction<A>, ActivationError>— Completes a deliberate primary pointer release.fn key_down<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey, value: A) -> Result<(), ActivationError>— Records a deliberate activation key press.fn key_up<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey) -> Result<BoundAction<A>, ActivationError>— Completes a deliberate activation key release.fn cancel(&mut self)— Drops a pending deliberate activation.
structaster_ui::component::RowMarker
pub struct RowMarker { /* see fields */ }The caller's selection indicator and the area it reserves.
Public fields
| field | type | |
|---|---|---|
surface | super::button::Surface | The caller's painted marker. |
size | [f64; 2] | The reserved indicator area in logical pixels. The width must fit the leading padding of the row and the height must fit the row's measured box; the marker is centred in that reserved column. |
Trait implementations: Clone, Debug
structaster_ui::component::RowSpec
pub struct RowSpec { /* see fields */ }The caller-owned identity, measured content and metrics of a row.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this row. |
label | super::label::Label | The measured title. The caller measures it with the real font; the row never derives, rounds or truncates it. |
padding | [f64; 4] | Caller-provided padding in logical pixels: left, top, right, bottom. |
focus_order | Option<u32> | The tab rank of this row, when it takes focus. |
marker | Option<RowMarker> | The caller's optional selection indicator. |
Trait implementations: Clone, Debug
structaster_ui::component::RowVisual
pub struct RowVisual { /* see fields */ }The picture a row prepares: its own state and the control's interaction state.
Public fields
| field | type | |
|---|---|---|
state | RowState | The row's own state. |
control | super::button::ControlState | The control's interaction state: pressed, focused or hovered. |
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
structaster_ui::component::Shell
pub struct Shell { /* see fields */ }A measured shell: a master column and a detail column.
Methods
const MAX_CONTROLS: usize— The default number of controls one shell holds.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ShellSpec) -> Result<Shell, ShellError>— Inserts the shell: the root and the two columns.fn with_capacity(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ShellSpec, capacity: usize) -> Result<Shell, ShellError>— Inserts the shell with an explicit bound on its controls.fn node(&self) -> NodeId— The root node of the shell.fn master_node(&self) -> NodeId— The master column: the caller inserts its list controls under it.fn detail_node(&self) -> NodeId— The detail column: the caller inserts its detail controls under it.fn outer_gap(&self) -> f64— The gap between the two columns, in logical pixels.fn column_gap(&self, column: ShellColumn) -> f64— The gap between the controls of one column, in logical pixels.fn set_outer_gap(&mut self, gap: f64) -> Result<(), ShellError>— Sets the gap between the two columns, in logical pixels.fn set_column_gap(&mut self, column: ShellColumn, gap: f64) -> Result<(), ShellError>— Sets the gap between the controls of one column, in logical pixels.fn controls(&self) -> &[ShellControl]— The registered controls, in registration order.fn interactions(&self) -> &[Interaction]— The interactions of the registered controls, in registration order.fn master_extent(&self) -> ShellExtent— The measured extent of the master column.fn detail_extent(&self) -> ShellExtent— The measured extent of the detail column.fn register(&mut self, control: ShellControl) -> Result<(), ShellError>— Registers a measured control with the shell.fn fit(&self, viewport: LayoutSize) -> Result<ShellFit, ShellError>— The measured fit of the shell in the viewport, from the registered controls.fn arrange(&mut self, edit: &mut Edit<'_>, viewport: LayoutSize) -> Result<ShellFit, ShellError>— Arranges the shell for the viewport.
Trait implementations: Clone, Debug
structaster_ui::component::ShellControl
pub struct ShellControl { /* see fields */ }One registered control of the shell.
Public fields
| field | type | |
|---|---|---|
column | ShellColumn | The column the control belongs to. |
node | NodeId | The control's node. The shell never replaces it: the identity of the caller's control survives every layout change. |
size | LayoutSize | The control's measured size, in logical pixels. |
minimum | LayoutSize | The control's minimum size, in logical pixels. |
interaction | Option<Interaction> | The interaction the control publishes with the frame. |
Trait implementations: Clone, Copy, Debug
structaster_ui::component::ShellExtent
pub struct ShellExtent { /* see fields */ }The measured extent of one shell column.
Public fields
| field | type | |
|---|---|---|
width | f64 | The measured width of the column, in logical pixels. |
height | f64 | The measured height of the column, in logical pixels. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::ShellSpec
pub struct ShellSpec { /* see fields */ }The caller's measured shell metrics.
Public fields
| field | type | |
|---|---|---|
padding | [f64; 4] | The caller's padding: left, top, right, bottom. |
gap | f64 | The gap between the columns and between the controls, in logical pixels. |
wide_at | f64 | The logical width at which the shell uses the two column layout. |
Methods
fn fit(&self, master: ShellExtent, detail: ShellExtent, viewport: LayoutSize) -> Result<ShellFit, ShellError>— The measured fit of the shell in the viewport.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::TextField
pub struct TextField { /* see fields */ }The retained field.
Methods
fn reflow(&self, edit: &mut Edit<'_>, document: &TextDocument, prepared: &TextFieldPrepared, layout: &TextFieldLayout, skin: &TextFieldSkin) -> Result<TextFieldApplied, TextFieldError>— Reflows the same four nodes using the caller's new prepared run, placement and skin. It does not shape, resize the output, edit the document, decide layout or acknowledge a frame. The horizontal scroll is clamped to the new viewport; it does not automatically reveal a caret.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &TextFieldSpec, skin: &TextFieldSkin, budget: &TextFieldBudget) -> Result<TextField, TextFieldError>— Inserts the field: the clipped container, the caller's text and the caret and the selection.fn node(&self) -> NodeId— The node of the field: the retained identity of the control.fn container_node(&self) -> NodeId— The node of the clipped container.fn text_node(&self) -> NodeId— The node of the visible text.fn caret_node(&self) -> NodeId— The node of the caret.fn selection_node(&self) -> NodeId— The node of the selection.fn key(&self) -> ModelKey— The stable model identity the caller assigned to the field.fn policy(&self) -> Interaction— The interaction policy of the field.fn state(&self) -> TextFieldState— The visible state of the field.fn source(&self) -> SourceStamp— The source stamp of the last presented document.fn revision(&self) -> DocumentRevision— The document revision of the last presented document.fn scroll(&self) -> f64— The visible scroll offset of the field, in logical pixels.fn width(&self) -> f64— The visible width of the field.fn height(&self) -> f64— The visible height of the field.fn scale(&self) -> f64— The output scale the field admitted.fn caret_rect(&self) -> LogicalRect— The caret the field currently shows.fn selection_rects(&self) -> &[LogicalRect]— The selection rectangles the field currently shows.fn present(&self, edit: &mut Edit<'_>, document: &TextDocument, prepared: &TextFieldPrepared) -> Result<TextFieldApplied, TextFieldError>— Presents the caller's document with the caller's prepared run.fn set_caret(&self, edit: &mut Edit<'_>, rect: LogicalRect) -> Result<TextFieldApplied, TextFieldError>— Admits the caret of the field.fn set_selection(&self, edit: &mut Edit<'_>, rects: &[LogicalRect]) -> Result<TextFieldApplied, TextFieldError>— Admits the selection of the field.fn set_scroll(&self, edit: &mut Edit<'_>, offset: f64) -> Result<TextFieldApplied, TextFieldError>— Scrolls the visible window of the field.fn set_state(&self, edit: &mut Edit<'_>, state: TextFieldState) -> Result<TextFieldApplied, TextFieldError>— Sets the visible state of the field.fn adopt(&mut self, applied: TextFieldApplied) -> Result<(), TextFieldError>— Installs a candidate, after the caller's edit was committed.fn move_caret(&self, document: &mut TextDocument, movement: TextMovement, extend: bool) -> Result<Option<DocumentChange>, TextFieldError>— Moves the caret of the caller's document.fn replace_selection(&self, document: &mut TextDocument, text: &str) -> Result<Option<DocumentChange>, TextFieldError>— Replaces the selection of the caller's document.fn delete(&self, document: &mut TextDocument, backward: bool) -> Result<Option<DocumentChange>, TextFieldError>— Deletes in the caller's document.fn pointer(&self, document: &mut TextDocument, prepared: &TextFieldPrepared, x: f64) -> Result<Option<DocumentChange>, TextFieldError>— Puts the caret where the pointer is.
Trait implementations: Clone, Debug
structaster_ui::component::TextFieldApplied
pub struct TextFieldApplied { /* see fields */ }A candidate field: the state a mutating operation would install.
The candidate is adopted only after the caller's edit was committed, so a dropped edit leaves the accepted field exactly as it was.
Trait implementations: Clone, Debug
structaster_ui::component::TextFieldBudget
pub struct TextFieldBudget { /* see fields */ }The caller's own node admission for the field.
Public fields
| field | type | |
|---|---|---|
used_nodes | usize | The nodes the scene already holds, as the caller counted them. |
node_capacity | usize | The nodes the presentation admits in total. |
output_scale | f64 | The exact output scale the content is prepared for. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::TextFieldLayout
pub struct TextFieldLayout { /* see fields */ }Caller-arranged geometry for retained reflow. All lengths are logical pixels. The caller prepares the new run for this exact output scale beforehand.
Public fields
| field | type | |
|---|---|---|
origin | [f64; 2] | |
width | f64 | |
padding | [f64; 4] | |
caret | f64 | |
output_scale | f64 |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::TextFieldPreparation
pub struct TextFieldPreparation { /* see fields */ }The caller's own preparation options for one shaped run.
Public fields
| field | type | |
|---|---|---|
color | Srgb8 | The colour of the prepared glyphs. |
scale | f64 | The exact output scale the run is prepared for. |
limits | TextDrawingLimits | The cold glyph admission limits. |
capacity | usize | The geometry capacity of the run, bounded by the document and the drawing limits. |
Trait implementations: Clone, Debug
structaster_ui::component::TextFieldPrepared
pub struct TextFieldPrepared { /* see fields */ }The prepared text and the geometry of one shaped run.
The fields are private: the caller cannot pair unrelated glyphs with an
unrelated geometry. The value is minted by TextFieldPrepared::new from a
single shaped run.
Methods
fn new(shaper: &mut TextShaper, font: &FontAsset, document: &TextDocument, options: RunOptions<'_>, preparation: &TextFieldPreparation) -> Result<Self, TextFieldError>— Prepares the text and the geometry of one shaped run.fn label(&self) -> &Label— The prepared label of the run.fn geometry(&self) -> &RunGeometry— The geometry of the run.fn source(&self) -> SourceStamp— The source stamp of the document the run was shaped from.fn revision(&self) -> DocumentRevision— The document revision the run was shaped from.fn scale(&self) -> f64— The output scale the run was prepared for.fn baseline(&self) -> f64— The baseline of the prepared text, in logical pixels from the top of the text's box.
structaster_ui::component::TextFieldSkin
pub struct TextFieldSkin { /* see fields */ }The caller's own appearance of the field.
Public fields
| field | type | |
|---|---|---|
surface | super::Surface | The surface behind the field. |
radius | f64 | The radius of the surface. |
caret | Paint | The paint of the caret. |
selection | Paint | The paint of the selection. |
Trait implementations: Clone, Debug
structaster_ui::component::TextFieldSpec
pub struct TextFieldSpec { /* see fields */ }The caller's own plan of the field.
The plan holds the prepared run, which owns the shaped geometry and is therefore neither cloneable nor printable: the plan does not pretend otherwise.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to the field. |
prepared | TextFieldPrepared | The prepared text and the geometry of one shaped run. |
padding | [f64; 4] | The field's own padding in logical pixels: left, top, right, bottom. |
width | f64 | The visible width of the field in logical pixels. |
caret | f64 | The thickness of the caret in logical pixels. |
structaster_ui::component::adaptive_grid::AdaptiveGrid
pub struct AdaptiveGrid { /* see fields */ }Storage and row-node count are bounded at construction. Item identity and registration order survive reflow. No cached edit state survives rollback.
Methods
const MAX_ITEMS: usizefn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: GridSpec, capacity: usize) -> Result<Self, GridError>— Creates one root pluscapacityempty reusable rows. Caller supplies scene/layout capacity. Scene failures poison the edit; drop that edit.fn node(&self) -> NodeIdfn len(&self) -> usizefn is_empty(&self) -> boolfn register(&mut self, node: NodeId, measured: LayoutSize) -> Result<(), GridError>— Measurement includes the caller's text, padding and visual/control minimums. Grid cells may grow but never shrink below this measurement.fn update_measure(&mut self, node: NodeId, measured: LayoutSize) -> Result<(), GridError>— Update a caller's accepted measurement without changing node identity. Text shaping/wrapping stays with the caller (for example TextFlow).fn fit(&self, available: LayoutSize) -> Result<GridFit, GridError>— Pure bounded preflight; no scene or grid state changes on NoFit/error.fn apply(&self, edit: &mut Edit<'_>, available: LayoutSize) -> Result<GridFit, GridError>— Installs candidate topology/styles only. The caller must still arrange the whole scene once, compose measurement callbacks, and commit. A scene failure poisons the edit; this helper stores no applied plan, so abandoning an edit cannot make its next application skip work.fn measure(&self, plan: GridPlan, node: NodeId) -> Option<LayoutSize>— Compose this borrowed lookup with the caller's measurements for other scene nodes. No rendering, shaping or frame allocation happens here.
structaster_ui::component::adaptive_grid::GridPlan
pub struct GridPlan { /* see fields */ }Methods
fn columns(self) -> usizefn rows(self) -> usizefn cell_size(self) -> LayoutSizefn extent(self) -> LayoutSize
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::adaptive_grid::GridSpec
pub struct GridSpec { /* see fields */ }Public fields
| field | type | |
|---|---|---|
padding | [f64; 4] | |
gap | f64 | |
minimum_cell | LayoutSize | |
max_columns | usize |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::button::Button
pub struct Button { /* see fields */ }A button inserted into a scene.
Methods
fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ButtonSpec, skin: &ButtonSkin) -> Result<Button, Error>— Inserts a button with its surface and label children.fn node(&self) -> NodeId— The root node that carries the identity and the interaction policy.fn key(&self) -> ModelKey— The caller-supplied stable model identity.fn size(&self) -> LayoutSize— The measured button size.fn minimum_width(&self) -> f64— The smallest width this button may occupy.fn current_size(&self) -> LayoutSize— The button's current size: the measured size with the current width and height.fn set_width(&mut self, edit: &mut Edit<'_>, origin: [f64; 2], width: f64) -> Result<bool, Error>— Sets the button's width, in logical pixels.fn set_size(&mut self, edit: &mut Edit<'_>, origin: [f64; 2], width: f64, height: f64) -> Result<bool, Error>— Sets the button's size, in logical pixels.fn set_label(&mut self, edit: &mut Edit<'_>, label: &Label, padding: [f64; 4], origin: [f64; 2], size: LayoutSize) -> Result<bool, Error>— Replaces the caller's prepared label and applies its arranged bounds.fn policy(&self) -> Interaction— The interaction policy for this button.fn set_focus_order(&mut self, focus_order: Option<u32>)— Sets the button's tab rank.fn focus_order(&self) -> Option<u32>— The button's current tab rank.fn prepare(&self, edit: &mut Edit<'_>, skin: &ButtonSkin, state: ControlState) -> Result<bool, Error>— Prepares the surface picture for a state.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::button::ButtonInput
pub struct ButtonInput<A> { /* see fields */ }Deliberate activation state for one button.
Activation requires a deliberate pairing: a primary pointer press and
release on this button, or an Enter/Space press and release while this
button holds focus. The pairing is bound to the exact acknowledged
snapshot and geometry through
[crate::app::Presentation::bind_action] and is revalidated with
[crate::app::Presentation::validate_action] before the action is
returned, so a stale release after a snapshot or geometry change is
refused instead of applied.
The disabled and busy flags are owned here, and they are the same flags
that refuse activation and that [ButtonInput::picture_state] reads, so
the picture cannot drift from the refusal. The application's snapshot and
the backend controller stay outside this type: the application maps its
own request phase onto [ButtonInput::set_busy].
Methods
fn new(button: &Button) -> Self— Creates the activation state of a button.fn bind<C: ControlContext>(&self, context: &C, value: A) -> Result<BoundAction<A>, ActivationError>— Explicit programmatic binding.fn pointer_down<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer, value: A) -> Result<(), ActivationError>— Records a deliberate primary pointer press on this button.fn pointer_up<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer) -> Result<BoundAction<A>, ActivationError>— Completes a deliberate primary pointer release on this button.fn key_down<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey, value: A) -> Result<(), ActivationError>— Records a deliberate activation key press on this button.fn key_up<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey) -> Result<BoundAction<A>, ActivationError>— Completes a deliberate activation key release on this button.fn cancel(&mut self)— Drops any pending deliberate activation.fn state(&self) -> ButtonState— The current deliberate input state.fn set_enabled(&mut self, enabled: bool)— Marks the control disabled. A disabled control refuses activation and is drawn as disabled. Disabling cancels any held gesture; enabling again requires a fresh press. This does not cancel an application request.fn set_busy(&mut self, busy: bool)— Marks the control busy. A busy control refuses activation and is drawn as busy. Becoming busy cancels any held gesture; clearing busy requires a fresh press. This does not cancel an application request.fn is_enabled(&self) -> bool— True while the control accepts activation.fn is_busy(&self) -> bool— True while the control refuses activation because a request is pending.fn picture_state(&self, focused: bool, hovered: bool) -> ControlState— The surface state implied by this control's own state and the caller's focus and hover observations.
structaster_ui::component::button::ButtonSkin
pub struct ButtonSkin { /* see fields */ }Caller-provided visual tokens for a button.
Public fields
| field | type | |
|---|---|---|
radius | f64 | Corner radius in logical pixels. |
idle | Surface | The idle surface. |
hover | Surface | The hovered surface. |
focus | Surface | The focused surface. |
pressed | Surface | The pressed surface. |
disabled | Surface | The disabled surface. |
busy | Surface | The busy surface. |
Trait implementations: Clone, Debug
structaster_ui::component::button::ButtonSpec
pub struct ButtonSpec { /* see fields */ }The caller-owned identity, measured content and metrics of a button.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this button. |
label | super::label::Label | The measured label content. |
padding | [f64; 4] | Caller-provided padding in logical pixels: left, top, right, bottom. |
focus_order | Option<u32> | The tab rank of this button, when it takes focus. |
Trait implementations: Clone, Debug
structaster_ui::component::card::Card
pub struct Card { /* see fields */ }A card inserted into a scene.
Methods
fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &CardSpec, skin: &CardSkin, budget: CardBudget) -> Result<Card, CardError>— Inserts a card with its surface, heading and content children.fn node(&self) -> NodeId— The root node that carries the identity and the box.fn surface_node(&self) -> NodeId— The node that carries the caller's surface.fn heading_node(&self) -> Option<NodeId>— The node that carries the measured heading, if the card has one.fn content_node(&self) -> Option<NodeId>— The node that carries the measured content, if the card has any.fn key(&self) -> ModelKey— The caller-supplied stable model identity.fn size(&self) -> LayoutSize— The measured size of the card.fn node_count(&self) -> usize— The exact number of scene nodes this card holds.fn prepare(&self, edit: &mut Edit<'_>, skin: &CardSkin) -> Result<bool, Error>— Prepares the surface picture of the card.fn semantic_description<'a>(&self, name: &'a str) -> Description<'a>— The semantic description of this card.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::card::CardBudget
pub struct CardBudget { /* see fields */ }The space, the node admission and the output scale the card must fit.
A card refuses before it touches the edit when it does not fit. It never wraps, truncates, clips or shrinks its measured content to make room.
Public fields
| field | type | |
|---|---|---|
available | LayoutSize | The size the card may occupy in its parent, in logical pixels. |
used_nodes | usize | The nodes the scene already holds, as the caller counted them. |
node_capacity | usize | The nodes the presentation admits in total. |
output_scale | f64 | The exact output scale of the frame the card's content is prepared for. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::card::CardSkin
pub struct CardSkin { /* see fields */ }The caller-owned appearance of a card.
Public fields
| field | type | |
|---|---|---|
radius | f64 | Corner radius in logical pixels. |
surface | super::button::Surface | The surface behind the card's content. |
Trait implementations: Clone, Debug
structaster_ui::component::card::CardSpec
pub struct CardSpec { /* see fields */ }The caller-owned identity, measured content and metrics of a card.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this card. |
heading | Option<super::label::Label> | The measured heading of the card, if the card has one. |
content | Option<super::label::Label> | The measured content of the card, if the card has any. |
padding | [f64; 4] | Caller-provided padding in logical pixels: left, top, right, bottom. |
gap | f64 | The gap between the heading and the content, in logical pixels. |
Methods
fn node_count(&self) -> usize— The exact number of scene nodes a card with this spec inserts.fn require_scale(&self, output_scale: f64) -> Result<(), Error>— Refuses a label that was prepared for a different output scale.
Trait implementations: Clone, Debug
structaster_ui::component::control_input::ControlGroupInput
pub struct ControlGroupInput<A: Clone> { /* see fields */ }A bounded group of the caller's own controls.
The group holds the registrations of the caller's own buttons and rows and routes the acknowledged input to them. It holds no history, no clock and no unbounded map: the number of registrations is the caller's own bound.
Methods
fn new(max: usize) -> Self— Creates a group that admits at mostmaxregistrations.fn len(&self) -> usize— The number of registered controls.fn is_empty(&self) -> bool— True when the group holds no registration.fn register_button(&mut self, button: &Button, action: A, snapshot: SnapshotId, context: &AcknowledgedContext<'_>) -> Result<(), ControlInputError>— Registers the caller's own button for an acknowledged plane.fn register_row(&mut self, row: &ListRow, action: A, snapshot: SnapshotId, context: &AcknowledgedContext<'_>) -> Result<(), ControlInputError>— Registers the caller's own row for an acknowledged plane.fn set_row_state(&mut self, node: NodeId, state: RowState) -> Result<(), ControlInputError>— Sets the deliberate state of a registered row.fn set_button_flags(&mut self, node: NodeId, enabled: bool, busy: bool) -> Result<(), ControlInputError>— Sets the deliberate flags of a registered button.fn pointer_with<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer) -> ControlOutcome<A>— Routes one pointer event to the registered controls.fn key_with<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey) -> ControlOutcome<A>— Routes one key event to the registered controls.fn cancel(&mut self)— Retires every pending deliberate input of the group.fn retain(&mut self, live: &[NodeId]) -> Vec<NodeId>— Retires the registrations of the controls that are gone.
structaster_ui::component::control_input::ControlOutcome
pub struct ControlOutcome<A> { /* see fields */ }The result of one routed event.
The activation is the exact [BoundAction] the control's own input
minted: its identity is the core's and the caller validates it against the
acknowledged plane, the source and the backend.
Public fields
| field | type | |
|---|---|---|
action | Option<app::BoundAction<A>> | The activation, when the deliberate pairing completed. |
capture | Option<(NodeId, PointerId)> | The capture proposal after a successful primary press: the node and the pointer. The caller maps it to its own host; this module has no native dependency. |
Trait implementations: Debug, Default
structaster_ui::component::label::Label
pub struct Label { /* see fields */ }Painted label content and its measured dimensions in logical pixels.
Methods
fn new(content: Arc<Recording>, advance: f64, height: f64) -> Result<Self, Error>— Builds a label from caller-provided content and measured dimensions.fn with_prepared_scale(self, output_scale: f64) -> Result<Self, Error>— Declares the output scale the content was prepared for (the scale of the glyph drawings the content records), so a frame at another scale refuses it (require_scale) instead of drawing it blurred.fn content(&self) -> &Arc<Recording>— The caller-provided painted content.fn advance(&self) -> f64— The measured horizontal advance in logical pixels.fn height(&self) -> f64— The measured line height in logical pixels.fn size(&self) -> LayoutSize— The measured content size.fn prepared_scale(&self) -> Option<f64>— The output scale the content was prepared for.fn require_scale(&self, output_scale: f64) -> Result<(), Error>— Refuses a label prepared for a different output scale.
Trait implementations: Clone, Debug
structaster_ui::component::label::TextRun
pub struct TextRun<'a> { /* see fields */ }The caller's text inputs for one measured label.
Public fields
| field | type | |
|---|---|---|
font | &'a FontAsset | The caller's font face. The kit never substitutes a font. |
source | TextSource<'a> | The accepted text source to measure. |
range | TextRange | The range inside the source to measure. |
options | RunOptions<'a> | The run options: logical size, direction, script and features. |
Trait implementations: Clone, Copy
structaster_ui::component::label::TextStyle
pub struct TextStyle { /* see fields */ }The caller's style and cold admission for the prepared label content.
Public fields
| field | type | |
|---|---|---|
color | Srgb8 | The colour of the prepared text. |
baseline | f64 | The baseline offset inside the label box, in logical pixels. |
output_scale | f64 | The exact output scale of the frame the content is prepared for. |
limits | TextDrawingLimits | The cold glyph admission limits. |
Trait implementations: Clone, Copy, Debug
structaster_ui::component::list_row::ListRow
pub struct ListRow { /* see fields */ }An interactive list row.
Methods
const NODE_COUNT: usize— The scene nodes a row costs: the composed button's root, its surface and its title label, plus the optional marker.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &RowSpec, skin: &ButtonSkin) -> Result<ListRow, Error>— Inserts the row: the composed button plus the optional marker.fn button(&self) -> &Button— The composed button. Its root carries the caller's model key and the interaction policy, and its activation is driven byRowInput.fn node(&self) -> NodeId— The root node of the row. The whole row is the target.fn key(&self) -> ModelKey— The caller-supplied stable model identity.fn policy(&self) -> Interaction— The interaction policy for this row.fn set_focus_order(&mut self, focus_order: Option<u32>)— Sets the row's tab rank.fn focus_order(&self) -> Option<u32>— The row's current tab rank.fn marker(&self) -> Option<RowMarker>— The row's current marker, if it has one.fn set_marker(&mut self, edit: &mut Edit<'_>, marker: Option<RowMarker>) -> Result<bool, Error>— Sets the row's selection marker.fn set_label(&mut self, edit: &mut Edit<'_>, label: &Label, padding: [f64; 4], origin: [f64; 2], size: LayoutSize) -> Result<bool, Error>— Replaces the row's caption with a caller-prepared label.fn size(&self) -> LayoutSize— The measured row size. It never changes with the state.fn minimum_width(&self) -> f64— The smallest width this row may occupy.fn current_size(&self) -> LayoutSize— The row's current size: the measured size with the current width and height.fn set_width(&mut self, edit: &mut Edit<'_>, origin: [f64; 2], width: f64) -> Result<bool, Error>— Sets the row's width, in logical pixels.fn set_size(&mut self, edit: &mut Edit<'_>, origin: [f64; 2], width: f64, height: f64) -> Result<bool, Error>— Sets the row's size, in logical pixels.fn fit(&self, available: f64) -> RowFit— The measured fit of this row's title in an available width.fn prepare(&self, edit: &mut Edit<'_>, skin: &ButtonSkin, visual: RowVisual) -> Result<bool, Error>— Prepares the surface and the marker for a picture.fn description<'a>(&self, name: &'a str, state: RowState, focused: bool) -> Description<'a>— The semantic description of the row for a state.
Trait implementations: Clone, Debug
structaster_ui::component::list_row::RowInput
pub struct RowInput<A> { /* see fields */ }The authoritative activation state of a row.
The row's state drives the activation gate, so a row that looks disabled or busy cannot activate: the consumer never has to set a second flag.
Methods
fn new(row: &ListRow) -> Self— Creates the activation state of a row.fn state(&self) -> RowState— The row's authoritative state.fn set_state(&mut self, state: RowState)— Sets the row's state. The activation gate follows it immediately.fn visual(&self, focused: bool, hovered: bool) -> RowVisual— The picture the row prepares for the current state.fn pointer_down<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer, value: A) -> Result<(), ActivationError>— Records a deliberate primary pointer press.fn pointer_up<C: ControlContext>(&mut self, context: &C, routed: &RoutedPointer) -> Result<BoundAction<A>, ActivationError>— Completes a deliberate primary pointer release.fn key_down<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey, value: A) -> Result<(), ActivationError>— Records a deliberate activation key press.fn key_up<C: ControlContext>(&mut self, context: &C, routed: &RoutedKey) -> Result<BoundAction<A>, ActivationError>— Completes a deliberate activation key release.fn cancel(&mut self)— Drops a pending deliberate activation.
structaster_ui::component::list_row::RowMarker
pub struct RowMarker { /* see fields */ }The caller's selection indicator and the area it reserves.
Public fields
| field | type | |
|---|---|---|
surface | super::button::Surface | The caller's painted marker. |
size | [f64; 2] | The reserved indicator area in logical pixels. The width must fit the leading padding of the row and the height must fit the row's measured box; the marker is centred in that reserved column. |
Trait implementations: Clone, Debug
structaster_ui::component::list_row::RowSpec
pub struct RowSpec { /* see fields */ }The caller-owned identity, measured content and metrics of a row.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this row. |
label | super::label::Label | The measured title. The caller measures it with the real font; the row never derives, rounds or truncates it. |
padding | [f64; 4] | Caller-provided padding in logical pixels: left, top, right, bottom. |
focus_order | Option<u32> | The tab rank of this row, when it takes focus. |
marker | Option<RowMarker> | The caller's optional selection indicator. |
Trait implementations: Clone, Debug
structaster_ui::component::list_row::RowVisual
pub struct RowVisual { /* see fields */ }The picture a row prepares: its own state and the control's interaction state.
Public fields
| field | type | |
|---|---|---|
state | RowState | The row's own state. |
control | super::button::ControlState | The control's interaction state: pressed, focused or hovered. |
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
structaster_ui::component::menu::Menu
pub struct Menu { /* see fields */ }A measured popup menu: the popup's own nodes and its measured items.
Methods
fn required_nodes(items: usize, markers: usize) -> usize— The scene nodes a menu costs: the popup root, the popup surface, three nodes per item and one more per item that carries a marker.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &MenuSpec, skin: &MenuSkin) -> Result<Menu, MenuError>— Inserts the popup and its measured items.fn node(&self) -> NodeId— The popup's root node: it carries the popup identity and the pointer policy of the popup background.fn surface_node(&self) -> NodeId— The popup's background surface node.fn key(&self) -> ModelKey— The caller's stable model identity of the popup.fn size(&self) -> LayoutSize— The measured size of the popup.fn origin(&self) -> [f64; 2]— The placement of the popup's top-left corner.fn content_width(&self) -> f64— The measured width of the item column.fn len(&self) -> usize— The number of items.fn is_empty(&self) -> bool— True when the menu has no items.fn row(&self, index: usize) -> Option<&ListRow>— The row of one item.fn item_key(&self, index: usize) -> Option<ModelKey>— The stable model identity of one item.fn index_of(&self, key: ModelKey) -> Option<usize>— The index of the item with this stable model identity.fn policies(&self) -> Vec<Interaction>— The interaction policies the popup publishes with the frame.fn prepare(&self, edit: &mut Edit<'_>, skin: &MenuSkin, visuals: &[RowVisual]) -> Result<bool, MenuError>— Prepares the popup surface and every item's picture.fn description<'a>(&self, name: &'a str) -> Description<'a>— The semantic description of the popup.
Trait implementations: Clone, Debug
structaster_ui::component::menu::MenuController
pub struct MenuController<A> { /* see fields */ }The menu's controller: the item states, the selection and the deliberate activation over the menu's rows.
The controller owns no open state: the application owns it and simply stops sending events to a closed menu. The controller owns the item states only as the mirror of the application's confirmed states, and it owns the selection, which it reports to the application instead of moving the focus itself.
Methods
fn new(menu: &Menu) -> Self— Creates the controller of a measured menu.fn menu(&self) -> &Menu— The measured menu this controller drives.fn len(&self) -> usize— The number of items.fn is_empty(&self) -> bool— True when the menu has no items.fn item_key(&self, index: usize) -> Option<ModelKey>— The stable model identity of one item.fn index_of(&self, key: ModelKey) -> Option<usize>— The index of the item with this stable model identity.fn state(&self, index: usize) -> Option<RowState>— The authoritative state of one item.fn set_state(&mut self, index: usize, state: RowState) -> Result<(), MenuError>— Sets the state of one item, from the application's confirmed model.fn selection(&self) -> Option<usize>— The menu's own selection.fn eligible(&self, index: usize) -> bool— True when the item may be selected and activated.fn select(&mut self, index: usize) -> Result<usize, MenuError>— Selects one item.fn select_next(&mut self) -> Option<usize>— Moves the selection to the next eligible item, wrapping around.fn select_previous(&mut self) -> Option<usize>— Moves the selection to the previous eligible item, wrapping around.fn visuals(&self, focused: Option<usize>, hovered: Option<usize>) -> Vec<RowVisual>— The picture of every item.fn pointer_down<C: MenuContext>(&mut self, context: &C, routed: &RoutedPointer, value: A) -> Result<MenuOutcome<A>, MenuError>— Records a deliberate primary pointer press.fn pointer_up<C: MenuContext>(&mut self, context: &C, routed: &RoutedPointer) -> Result<MenuOutcome<A>, MenuError>— Completes a deliberate primary pointer release.fn key_down<C: MenuContext>(&mut self, context: &C, routed: &RoutedKey, value: A) -> Result<MenuOutcome<A>, MenuError>— Records a key event.fn key_up<C: MenuContext>(&mut self, context: &C, routed: &RoutedKey) -> Result<MenuOutcome<A>, MenuError>— Completes a deliberate activation key release.fn cancel(&mut self)— Drops every pending deliberate activation.
structaster_ui::component::menu::MenuItemSpec
pub struct MenuItemSpec { /* see fields */ }One measured menu item.
The item is a row: the caller's stable model identity, the caller's measured label, the caller's padding, the caller's optional selection marker and the caller's tab rank. The menu chooses no font, no material and no text.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity of this item. The application keeps this identity across the item's whole life; the menu never invents one. |
label | component::label::Label | The measured label of the item. |
padding | [f64; 4] | The item padding in logical pixels: left, top, right, bottom. |
focus_order | Option<u32> | The tab rank of the item, when it takes focus. |
marker | Option<component::list_row::RowMarker> | The caller's selection marker, drawn for the selected item. |
state | component::list_row::RowState | The initial state of the item. |
Trait implementations: Clone, Debug
structaster_ui::component::menu::MenuMetrics
pub struct MenuMetrics { /* see fields */ }The measured metrics of a popup menu.
Public fields
| field | type | |
|---|---|---|
item_gap | f64 | The vertical gap between two items, in logical pixels. |
padding | [f64; 4] | The popup padding in logical pixels: left, top, right, bottom. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::menu::MenuSkin
pub struct MenuSkin { /* see fields */ }The caller's appearance of a popup menu.
The item skin is the caller's own button skin, reused verbatim: the menu adds no material, no palette and no radius of its own.
Public fields
| field | type | |
|---|---|---|
surface | component::button::Surface | The popup's background surface. |
items | component::button::ButtonSkin | The caller's item skin. |
Trait implementations: Clone, Debug
structaster_ui::component::menu::MenuSpec
pub struct MenuSpec { /* see fields */ }The caller-owned identity, items and metrics of a popup menu.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity of the popup itself. |
items | Vec<MenuItemSpec> | The measured items, in display order. |
metrics | MenuMetrics | The measured metrics of the popup. |
origin | [f64; 2] | The placement of the popup's top-left corner, in the parent's space. |
viewport | LogicalRect | The space the popup may occupy, in the parent's space. |
Trait implementations: Clone, Debug
structaster_ui::component::progress::Progress
pub struct Progress { /* see fields */ }A progress control inserted into a scene.
The three node identities are stable: an update reuses them and never inserts a node, so the scene keeps its own node identities across the whole life of the control.
Methods
fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ProgressSpec, skin: &ProgressSkin, budget: ProgressBudget) -> Result<Progress, ProgressError>— Inserts a progress control with its track and fill children.fn root(&self) -> NodeId— The root node that carries the identity and the box.fn track_node(&self) -> NodeId— The node that carries the caller's track.fn fill_node(&self) -> NodeId— The node that carries the fill.fn key(&self) -> ModelKey— The caller-supplied stable model identity.fn size(&self) -> LayoutSize— The measured size of the control.fn orientation(&self) -> ProgressOrientation— The direction the fill advances in.fn value(&self) -> ProgressValue— The value the control currently shows.fn layout(&self) -> ProgressLayout— The measured layout of the control.fn node_count(&self) -> usize— The exact number of scene nodes this control holds.fn command_count(&self) -> usize— The exact number of recording commands this control contributes.fn set_value(&mut self, edit: &mut Edit<'_>, value: ProgressValue) -> Result<bool, Error>— Applies a new caller value to the existing fill node.fn set_extent(&mut self, edit: &mut Edit<'_>, width: f64, height: f64) -> Result<bool, Error>— Applies a new caller extent to the existing nodes.fn prepare(&self, edit: &mut Edit<'_>, skin: &ProgressSkin) -> Result<bool, Error>— Prepares the track and the fill pictures of the control.fn semantic_description<'a>(&self, name: &'a str) -> Description<'a>— The semantic description of this control.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::progress::ProgressBudget
pub struct ProgressBudget { /* see fields */ }The space and the node admission the progress control must fit.
A progress control refuses before it touches the edit when it does not fit. It never wraps, truncates, clips or shrinks itself to make room.
Public fields
| field | type | |
|---|---|---|
available | LayoutSize | The size the control may occupy in its parent, in logical pixels. |
used_nodes | usize | The nodes the scene already holds, as the caller counted them. |
node_capacity | usize | The nodes the presentation admits in total. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::progress::ProgressLayout
pub struct ProgressLayout { /* see fields */ }The measured geometry of a progress control.
The layout is derived from the caller's spec once and then carried by the control. Every bound is exact: the layout never rounds a fraction and never rounds a pixel.
Methods
fn measure(spec: &ProgressSpec) -> Result<Self, ProgressError>— Measures the layout of the caller's spec.fn size(&self) -> LayoutSize— The measured size of the control, in logical pixels.fn orientation(&self) -> ProgressOrientation— The direction the fill advances in.fn value(&self) -> ProgressValue— The value the layout was measured for.fn track_bounds(&self) -> LogicalRect— The bounds of the track: the whole extent of the control.fn fill_bounds(&self) -> LogicalRect— The bounds of the fill for the current value.fn with_value(&self, value: ProgressValue) -> Result<Self, ProgressError>— The layout of the same extent with a new caller value.fn with_extent(&self, width: f64, height: f64) -> Result<Self, ProgressError>— The layout of the same value with a new caller extent.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::progress::ProgressSkin
pub struct ProgressSkin { /* see fields */ }The caller-owned appearance of a progress control.
Public fields
| field | type | |
|---|---|---|
radius | f64 | The corner radius of the track and of the fill, in logical pixels. |
track | super::button::Surface | The caller's surface behind the fill. |
fill | super::button::Surface | The caller's surface of the fill itself. |
Trait implementations: Clone, Debug
structaster_ui::component::progress::ProgressSpec
pub struct ProgressSpec { /* see fields */ }The caller-owned identity, value and extent of a progress control.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this control. |
value | ProgressValue | The caller's value: a determinate fraction or an indeterminate phase. |
width | f64 | The logical width of the control, in logical pixels. |
height | f64 | The logical height of the control, in logical pixels. |
Methods
fn node_count(&self) -> usize— The exact number of scene nodes a progress control with this spec inserts.fn layout(&self) -> Result<ProgressLayout, ProgressError>— The measured layout of the caller's spec.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::recipe::ActionHandle
pub struct ActionHandle { /* see fields */ }A retained action of the panel: the real control and its real identity.
Methods
fn key(&self) -> ModelKey— The stable model identity the caller assigned to the action.fn node(&self) -> NodeId— The node of the action: the target of the acknowledged routing and the node the caller binds its action to.fn title_node(&self) -> NodeId— The node of the retained text of the action.fn policy(&self) -> Interaction— The interaction policy the action publishes with the frame.fn is_enabled(&self) -> bool— True while the action accepts a deliberate activation.fn is_busy(&self) -> bool— True while a request for this action is pending.fn natural_size(&self) -> LayoutSize— The measured size of the action.fn button(&self) -> &Button— The composed button control.fn description<'a>(&self, name: &'a str, focused: bool) -> Description<'a>— The semantic description of the action.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::recipe::DetailHandle
pub struct DetailHandle { /* see fields */ }A retained detail of the panel: the real card and its real identity.
Methods
fn key(&self) -> ModelKey— The stable model identity the caller assigned to the detail.fn node(&self) -> NodeId— The node of the detail.fn surface_node(&self) -> NodeId— The node of the detail's surface.fn heading_node(&self) -> Option<NodeId>— The node of the retained heading of the detail.fn content_node(&self) -> Option<NodeId>— The node of the retained content of the detail.fn natural_size(&self) -> LayoutSize— The measured size of the detail.fn card(&self) -> &Card— The composed card control.fn description<'a>(&self, name: &'a str) -> Description<'a>— The semantic description of the detail.
Trait implementations: Clone, Copy, Debug
structaster_ui::component::recipe::EntryHandle
pub struct EntryHandle { /* see fields */ }A retained entry of the panel: the real control and its real identity.
Methods
fn key(&self) -> ModelKey— The stable model identity the caller assigned to the entry.fn node(&self) -> NodeId— The node of the entry: the target of the acknowledged routing and the node the caller binds its action to.fn title_node(&self) -> NodeId— The node of the retained text of the entry.fn policy(&self) -> Interaction— The interaction policy the entry publishes with the frame.fn state(&self) -> RowState— The entry's own state.fn role(&self) -> EntryRole— The semantic role the caller gave the entry.fn natural_size(&self) -> LayoutSize— The measured size of the entry, without the column's stretch.fn row(&self) -> &ListRow— The composed row control.fn description<'a>(&self, name: &'a str, focused: bool) -> Description<'a>— The semantic description of the entry.
Trait implementations: Clone, Debug
structaster_ui::component::recipe::Recipe
pub struct Recipe { /* see fields */ }A retained panel: the composed controls and their measured layout.
Methods
const MAX_ENTRIES: usize— The default number of entries one panel holds.const MAX_ACTIONS: usize— The default number of actions one panel holds.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &RecipeSpec, skin: &RecipeSkin, budget: &RecipeBudget) -> Result<Recipe, RecipeError>— Inserts the panel: the root, the two columns, the entries, the detail and the actions.fn node(&self) -> NodeId— The root node of the panel.fn list_node(&self) -> NodeId— The list column of the panel: the caller's entries live under it.fn detail_column_node(&self) -> NodeId— The detail column of the panel: the detail and the actions live under it.fn action_row_node(&self) -> Option<NodeId>— The action row of the panel, if the panel has actions.fn entries(&self) -> &[EntryHandle]— The retained entries of the panel, in the panel's own order.fn entry(&self, key: ModelKey) -> Option<&EntryHandle>— The retained entry of the given model identity.fn actions(&self) -> &[ActionHandle]— The retained actions of the panel, in the panel's own order.fn action(&self, key: ModelKey) -> Option<&ActionHandle>— The retained action of the given model identity.fn detail(&self) -> Option<&DetailHandle>— The retained detail of the panel.fn interactions(&self) -> &[Interaction]— The interactions the panel publishes with the frame.fn plan(&self, spec: &RecipeSpec) -> Result<RecipePlan, RecipeError>— The candidate plan of a new plan of the panel.fn plan_at_scale(&self, spec: &RecipeSpec, scale: f64) -> Result<RecipePlan, RecipeError>— The candidate plan of a new plan at an explicit output scale.fn fit(&self, viewport: LayoutSize) -> Result<ShellFit, RecipeError>— The measured fit of the panel's current state in a viewport.fn fit_plan(&self, plan: &RecipePlan, viewport: LayoutSize) -> Result<ShellFit, RecipeError>— The measured fit of a candidate plan in a viewport.fn apply(&self, edit: &mut Edit<'_>, plan: &RecipePlan, viewport: LayoutSize, skin: &RecipeSkin, measure: &mut impl FnMut(NodeId, LayoutConstraints) -> Result<LayoutSize, Error>) -> Result<RecipeApplied, RecipeError>— Writes a candidate plan into the caller's edit and arranges it.fn arrange(&self, edit: &mut Edit<'_>, viewport: LayoutSize, measure: &mut impl FnMut(NodeId, LayoutConstraints) -> Result<LayoutSize, Error>) -> Result<RecipeApplied, RecipeError>— Arranges the panel's current state in a viewport.fn adopt(&mut self, applied: RecipeApplied) -> Result<(), RecipeError>— Installs an applied panel after the caller committed its edit.
Trait implementations: Clone, Debug
structaster_ui::component::recipe::RecipeAction
pub struct RecipeAction { /* see fields */ }The caller's own plan for one action of the panel.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this action. |
label | super::label::Label | The measured label of the action. |
enabled | bool | True while the action accepts a deliberate activation. |
busy | bool | True while a request for this action is pending. |
focus_order | Option<u32> | The tab rank of the action, when it takes focus. |
padding | [f64; 4] | The padding of the action in logical pixels: left, top, right, bottom. |
Trait implementations: Clone, Debug
structaster_ui::component::recipe::RecipeApplied
pub struct RecipeApplied { /* see fields */ }The applied state of a panel: the retained controls and their measurements, ready to be adopted once the edit was committed.
Methods
fn fit(&self) -> ShellFit— The measured fit of the applied panel.fn interactions(&self) -> &[Interaction]— The interactions the applied panel publishes with the frame.
Trait implementations: Clone, Debug
structaster_ui::component::recipe::RecipeBudget
pub struct RecipeBudget { /* see fields */ }The space, the node admission and the output scale the panel must fit.
Public fields
| field | type | |
|---|---|---|
used_nodes | usize | The nodes the scene already holds, as the caller counted them. |
node_capacity | usize | The nodes the presentation admits in total. |
output_scale | f64 | The exact output scale of the frame the content is prepared for. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::recipe::RecipeDetail
pub struct RecipeDetail { /* see fields */ }The caller's own plan for the panel's detail.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to the detail. |
heading | Option<super::label::Label> | The measured heading of the detail, if it has one. |
content | Option<super::label::Label> | The measured content of the detail, if it has any. |
padding | [f64; 4] | The padding of the detail in logical pixels: left, top, right, bottom. |
gap | f64 | The gap between the heading and the content, in logical pixels. |
Trait implementations: Clone, Debug
structaster_ui::component::recipe::RecipeEntry
pub struct RecipeEntry { /* see fields */ }The caller's own plan for one entry of the panel's list.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this entry. |
title | super::label::Label | The measured title. The caller measures it with the real font; the recipe never derives, rounds or truncates it. |
state | super::list_row::RowState | The entry's own state: idle, selected, loading, disabled or busy. |
marker | Option<super::list_row::RowMarker> | The caller's optional selection marker. |
focus_order | Option<u32> | The tab rank of the entry, when it takes focus. |
role | EntryRole | The semantic role the caller gives the entry. |
padding | [f64; 4] | The padding of the entry in logical pixels: left, top, right, bottom. |
Trait implementations: Clone, Debug
structaster_ui::component::recipe::RecipePlan
pub struct RecipePlan { /* see fields */ }A candidate plan of a panel: the measured result of a new plan.
The plan is pure. It touches no scene and no edit, so the caller can ask for the fit of a plan before it writes anything.
Methods
fn entry_count(&self) -> usize— The number of entries of the plan.fn action_count(&self) -> usize— The number of actions of the plan.fn removed_entries(&self) -> &[ModelKey]— The model identities of the entries the plan drops.fn removed_actions(&self) -> &[ModelKey]— The model identities of the actions the plan drops.
Trait implementations: Clone, Debug
structaster_ui::component::recipe::RecipeSkin
pub struct RecipeSkin { /* see fields */ }The caller's own appearance of a panel.
Public fields
| field | type | |
|---|---|---|
row | super::button::ButtonSkin | The skin of the list entries. |
card | super::card::CardSkin | The skin of the detail card. |
action | super::button::ButtonSkin | The skin of the actions. |
Trait implementations: Clone, Debug
structaster_ui::component::recipe::RecipeSpec
pub struct RecipeSpec { /* see fields */ }The caller's own plan of a panel.
Public fields
| field | type | |
|---|---|---|
shell | super::shell::ShellSpec | The measured shell metrics of the panel: its padding, the gap between the columns and the breakpoint between the two layouts. |
row_gap | f64 | The gap between the entries of the list and between the detail and the action row, in logical pixels. |
action_gap | f64 | The gap between the actions inside the action row, in logical pixels. |
entries | Vec<RecipeEntry> | The entries of the list, in the caller's own order. |
detail | Option<RecipeDetail> | The detail of the panel, if it has one. |
actions | Vec<RecipeAction> | The actions of the panel, in the caller's own order. |
Trait implementations: Clone, Debug
structaster_ui::component::shell::Shell
pub struct Shell { /* see fields */ }A measured shell: a master column and a detail column.
Methods
const MAX_CONTROLS: usize— The default number of controls one shell holds.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ShellSpec) -> Result<Shell, ShellError>— Inserts the shell: the root and the two columns.fn with_capacity(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ShellSpec, capacity: usize) -> Result<Shell, ShellError>— Inserts the shell with an explicit bound on its controls.fn node(&self) -> NodeId— The root node of the shell.fn master_node(&self) -> NodeId— The master column: the caller inserts its list controls under it.fn detail_node(&self) -> NodeId— The detail column: the caller inserts its detail controls under it.fn outer_gap(&self) -> f64— The gap between the two columns, in logical pixels.fn column_gap(&self, column: ShellColumn) -> f64— The gap between the controls of one column, in logical pixels.fn set_outer_gap(&mut self, gap: f64) -> Result<(), ShellError>— Sets the gap between the two columns, in logical pixels.fn set_column_gap(&mut self, column: ShellColumn, gap: f64) -> Result<(), ShellError>— Sets the gap between the controls of one column, in logical pixels.fn controls(&self) -> &[ShellControl]— The registered controls, in registration order.fn interactions(&self) -> &[Interaction]— The interactions of the registered controls, in registration order.fn master_extent(&self) -> ShellExtent— The measured extent of the master column.fn detail_extent(&self) -> ShellExtent— The measured extent of the detail column.fn register(&mut self, control: ShellControl) -> Result<(), ShellError>— Registers a measured control with the shell.fn fit(&self, viewport: LayoutSize) -> Result<ShellFit, ShellError>— The measured fit of the shell in the viewport, from the registered controls.fn arrange(&mut self, edit: &mut Edit<'_>, viewport: LayoutSize) -> Result<ShellFit, ShellError>— Arranges the shell for the viewport.
Trait implementations: Clone, Debug
structaster_ui::component::shell::ShellControl
pub struct ShellControl { /* see fields */ }One registered control of the shell.
Public fields
| field | type | |
|---|---|---|
column | ShellColumn | The column the control belongs to. |
node | NodeId | The control's node. The shell never replaces it: the identity of the caller's control survives every layout change. |
size | LayoutSize | The control's measured size, in logical pixels. |
minimum | LayoutSize | The control's minimum size, in logical pixels. |
interaction | Option<Interaction> | The interaction the control publishes with the frame. |
Trait implementations: Clone, Copy, Debug
structaster_ui::component::shell::ShellExtent
pub struct ShellExtent { /* see fields */ }The measured extent of one shell column.
Public fields
| field | type | |
|---|---|---|
width | f64 | The measured width of the column, in logical pixels. |
height | f64 | The measured height of the column, in logical pixels. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::shell::ShellSpec
pub struct ShellSpec { /* see fields */ }The caller's measured shell metrics.
Public fields
| field | type | |
|---|---|---|
padding | [f64; 4] | The caller's padding: left, top, right, bottom. |
gap | f64 | The gap between the columns and between the controls, in logical pixels. |
wide_at | f64 | The logical width at which the shell uses the two column layout. |
Methods
fn fit(&self, master: ShellExtent, detail: ShellExtent, viewport: LayoutSize) -> Result<ShellFit, ShellError>— The measured fit of the shell in the viewport.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::stepper::Stepper
pub struct Stepper { /* see fields */ }Retained handles. Clone before speculative edits, commit then adopt the clone.
Methods
const NODE_COUNT: usize— Current implementation uses one container, one value and two 3-node Buttons.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &StepperSpec, skin: &ButtonSkin, available: LayoutSize) -> Result<Self, StepperError>— Insert after geometry, scale, identity and fit preflight. These refusals leave the edit usable. Scene capacity failures poison it as usual.fn node(&self) -> NodeId— Container identity, with no input policy of its own.fn key(&self) -> ModelKey— Caller-owned container model key.fn button(&self, direction: StepDirection) -> &Button— Existing Button used for registration and deliberate input.fn value_node(&self) -> NodeId— Existing prepared-value node.fn size(&self) -> LayoutSize— Current logical size.fn origin(&self) -> [f64; 2]— Current origin in the parent's logical coordinates.fn interactions(&self) -> [Interaction; 2]— Existing two Button policies, in decrement/increment order.fn reposition(&mut self, edit: &mut Edit<'_>, origin: [f64; 2]) -> Result<bool, StepperError>— Move the container; all children move with it. Local metadata is speculative until the caller commits/adopts this handle.fn set_value(&mut self, edit: &mut Edit<'_>, value: &Label, available: LayoutSize, output_scale: f64) -> Result<bool, StepperError>— Replace only the caller's prepared value and reflow retained nodes. NoFit/wrong-scale refuse before writes. Existing direction labels must still match the scale; use [Self::set_labels] to replace them too. This never rescales glyphs. A scene failure requires dropping the edit/candidate.fn set_labels(&mut self, edit: &mut Edit<'_>, value: &Label, directions: [&Label; 2], available: LayoutSize, output_scale: f64) -> Result<bool, StepperError>— Replace all caller-prepared labels and reflow the retained controls.fn prepare(&self, edit: &mut Edit<'_>, skin: &ButtonSkin, states: [ControlState; 2]) -> Result<bool, Error>— Prepare the two existing Button surfaces from caller-owned states. Paint, semantics and input flags must be derived from that same state.fn description<'a>(&self, name: &'a str) -> Description<'a>— Container semantics; not a spinbutton or numeric authority contract.fn value_description<'a>(&self, name: &'a str) -> Description<'a>— Value semantics, provided verbatim by the caller.fn button_description<'a>(&self, direction: StepDirection, name: &'a str, state: ControlState, focused: bool) -> Description<'a>— One Button's semantics. Unavailable states never advertise Activate.
Trait implementations: Clone, Debug
structaster_ui::component::stepper::StepperSpec
pub struct StepperSpec { /* see fields */ }Caller-owned labels, identities and layout metrics.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | Identity of the non-interactive container. |
decrement_key | ModelKey | Identity of the decrement Button. |
increment_key | ModelKey | Identity of the increment Button. |
value | component::Label | Prepared value presentation; never parsed as a number. |
decrement | component::Label | Prepared decrement caption. |
increment | component::Label | Prepared increment caption. |
padding | [f64; 4] | Outer left/top/right/bottom padding. |
button_padding | [f64; 4] | Padding of each existing Button, expanded symmetrically to a 44px target. |
gap | f64 | Gap on each side of the value. |
focus_order | [Option<u32>; 2] | Explicit decrement/increment tab ranks. |
output_scale | f64 | Output scale for prepared-label admission. |
Trait implementations: Clone, Debug
structaster_ui::component::text_field::TextField
pub struct TextField { /* see fields */ }The retained field.
Methods
fn reflow(&self, edit: &mut Edit<'_>, document: &TextDocument, prepared: &TextFieldPrepared, layout: &TextFieldLayout, skin: &TextFieldSkin) -> Result<TextFieldApplied, TextFieldError>— Reflows the same four nodes using the caller's new prepared run, placement and skin. It does not shape, resize the output, edit the document, decide layout or acknowledge a frame. The horizontal scroll is clamped to the new viewport; it does not automatically reveal a caret.fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &TextFieldSpec, skin: &TextFieldSkin, budget: &TextFieldBudget) -> Result<TextField, TextFieldError>— Inserts the field: the clipped container, the caller's text and the caret and the selection.fn node(&self) -> NodeId— The node of the field: the retained identity of the control.fn container_node(&self) -> NodeId— The node of the clipped container.fn text_node(&self) -> NodeId— The node of the visible text.fn caret_node(&self) -> NodeId— The node of the caret.fn selection_node(&self) -> NodeId— The node of the selection.fn key(&self) -> ModelKey— The stable model identity the caller assigned to the field.fn policy(&self) -> Interaction— The interaction policy of the field.fn state(&self) -> TextFieldState— The visible state of the field.fn source(&self) -> SourceStamp— The source stamp of the last presented document.fn revision(&self) -> DocumentRevision— The document revision of the last presented document.fn scroll(&self) -> f64— The visible scroll offset of the field, in logical pixels.fn width(&self) -> f64— The visible width of the field.fn height(&self) -> f64— The visible height of the field.fn scale(&self) -> f64— The output scale the field admitted.fn caret_rect(&self) -> LogicalRect— The caret the field currently shows.fn selection_rects(&self) -> &[LogicalRect]— The selection rectangles the field currently shows.fn present(&self, edit: &mut Edit<'_>, document: &TextDocument, prepared: &TextFieldPrepared) -> Result<TextFieldApplied, TextFieldError>— Presents the caller's document with the caller's prepared run.fn set_caret(&self, edit: &mut Edit<'_>, rect: LogicalRect) -> Result<TextFieldApplied, TextFieldError>— Admits the caret of the field.fn set_selection(&self, edit: &mut Edit<'_>, rects: &[LogicalRect]) -> Result<TextFieldApplied, TextFieldError>— Admits the selection of the field.fn set_scroll(&self, edit: &mut Edit<'_>, offset: f64) -> Result<TextFieldApplied, TextFieldError>— Scrolls the visible window of the field.fn set_state(&self, edit: &mut Edit<'_>, state: TextFieldState) -> Result<TextFieldApplied, TextFieldError>— Sets the visible state of the field.fn adopt(&mut self, applied: TextFieldApplied) -> Result<(), TextFieldError>— Installs a candidate, after the caller's edit was committed.fn move_caret(&self, document: &mut TextDocument, movement: TextMovement, extend: bool) -> Result<Option<DocumentChange>, TextFieldError>— Moves the caret of the caller's document.fn replace_selection(&self, document: &mut TextDocument, text: &str) -> Result<Option<DocumentChange>, TextFieldError>— Replaces the selection of the caller's document.fn delete(&self, document: &mut TextDocument, backward: bool) -> Result<Option<DocumentChange>, TextFieldError>— Deletes in the caller's document.fn pointer(&self, document: &mut TextDocument, prepared: &TextFieldPrepared, x: f64) -> Result<Option<DocumentChange>, TextFieldError>— Puts the caret where the pointer is.
Trait implementations: Clone, Debug
structaster_ui::component::text_field::TextFieldApplied
pub struct TextFieldApplied { /* see fields */ }A candidate field: the state a mutating operation would install.
The candidate is adopted only after the caller's edit was committed, so a dropped edit leaves the accepted field exactly as it was.
Trait implementations: Clone, Debug
structaster_ui::component::text_field::TextFieldBudget
pub struct TextFieldBudget { /* see fields */ }The caller's own node admission for the field.
Public fields
| field | type | |
|---|---|---|
used_nodes | usize | The nodes the scene already holds, as the caller counted them. |
node_capacity | usize | The nodes the presentation admits in total. |
output_scale | f64 | The exact output scale the content is prepared for. |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::text_field::TextFieldLayout
pub struct TextFieldLayout { /* see fields */ }Caller-arranged geometry for retained reflow. All lengths are logical pixels. The caller prepares the new run for this exact output scale beforehand.
Public fields
| field | type | |
|---|---|---|
origin | [f64; 2] | |
width | f64 | |
padding | [f64; 4] | |
caret | f64 | |
output_scale | f64 |
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
structaster_ui::component::text_field::TextFieldPreparation
pub struct TextFieldPreparation { /* see fields */ }The caller's own preparation options for one shaped run.
Public fields
| field | type | |
|---|---|---|
color | Srgb8 | The colour of the prepared glyphs. |
scale | f64 | The exact output scale the run is prepared for. |
limits | TextDrawingLimits | The cold glyph admission limits. |
capacity | usize | The geometry capacity of the run, bounded by the document and the drawing limits. |
Trait implementations: Clone, Debug
structaster_ui::component::text_field::TextFieldPrepared
pub struct TextFieldPrepared { /* see fields */ }The prepared text and the geometry of one shaped run.
The fields are private: the caller cannot pair unrelated glyphs with an
unrelated geometry. The value is minted by TextFieldPrepared::new from a
single shaped run.
Methods
fn new(shaper: &mut TextShaper, font: &FontAsset, document: &TextDocument, options: RunOptions<'_>, preparation: &TextFieldPreparation) -> Result<Self, TextFieldError>— Prepares the text and the geometry of one shaped run.fn label(&self) -> &Label— The prepared label of the run.fn geometry(&self) -> &RunGeometry— The geometry of the run.fn source(&self) -> SourceStamp— The source stamp of the document the run was shaped from.fn revision(&self) -> DocumentRevision— The document revision the run was shaped from.fn scale(&self) -> f64— The output scale the run was prepared for.fn baseline(&self) -> f64— The baseline of the prepared text, in logical pixels from the top of the text's box.
structaster_ui::component::text_field::TextFieldSkin
pub struct TextFieldSkin { /* see fields */ }The caller's own appearance of the field.
Public fields
| field | type | |
|---|---|---|
surface | super::Surface | The surface behind the field. |
radius | f64 | The radius of the surface. |
caret | Paint | The paint of the caret. |
selection | Paint | The paint of the selection. |
Trait implementations: Clone, Debug
structaster_ui::component::text_field::TextFieldSpec
pub struct TextFieldSpec { /* see fields */ }The caller's own plan of the field.
The plan holds the prepared run, which owns the shaped geometry and is therefore neither cloneable nor printable: the plan does not pretend otherwise.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to the field. |
prepared | TextFieldPrepared | The prepared text and the geometry of one shaped run. |
padding | [f64; 4] | The field's own padding in logical pixels: left, top, right, bottom. |
width | f64 | The visible width of the field in logical pixels. |
caret | f64 | The thickness of the caret in logical pixels. |
structaster_ui::component::toggle::Toggle
pub struct Toggle { /* see fields */ }A caller-owned boolean switch.
The handle is Clone, like the row's: a caller that works on a candidate
copy keeps the accepted handle untouched and adopts the copy when its
edit is committed.
Methods
fn insert(edit: &mut Edit<'_>, parent: Option<NodeId>, spec: &ToggleSpec, skin: &ToggleSkin, available: LayoutSize) -> Result<Toggle, ToggleError>— Inserts the toggle: the composed target, its track and its thumb.fn button(&self) -> &Button— The composed button. Its root is the whole target: it carries the caller's key and the interaction policy, and its activation is driven by the shippedButtonInputover this very button.fn node(&self) -> NodeId— The root node: the target of the acknowledged routing.fn key(&self) -> ModelKey— The caller's stable model identity.fn track_node(&self) -> NodeId— The node of the track.fn thumb_node(&self) -> NodeId— The node of the thumb.fn size(&self) -> LayoutSize— The intrinsic size of the whole target.fn policy(&self) -> Interaction— The interaction policy of the toggle.fn reposition(&mut self, edit: &mut Edit<'_>, origin: [f64; 2]) -> Result<bool, ToggleError>— Moves the target without changing its size.fn origin(&self) -> [f64; 2]— The origin the toggle was last moved to.fn prepare(&self, edit: &mut Edit<'_>, skin: &ToggleSkin, on: bool, state: ControlState) -> Result<bool, Error>— Prepares the target, the track and the thumb for a picture.fn description<'a>(&self, name: &'a str, control: ControlState, on: bool, focused: bool) -> Description<'a>— The semantic description of the toggle.
Trait implementations: Clone, Debug
structaster_ui::component::toggle::ToggleSkin
pub struct ToggleSkin { /* see fields */ }The caller's own appearance of a toggle.
The control skin is the existing button skin: it carries the whole target's focus, hover, pressed, disabled and busy feedback. The track and the thumb carry the caller's own surfaces; a recorded material is not resampled for the toggle's geometry, exactly like the button's surface.
Public fields
| field | type | |
|---|---|---|
control | component::ButtonSkin | The whole target's control skin. |
radius | f64 | The corner radius of the track and of the thumb, in logical pixels. |
off | component::Surface | The track's surface while the toggle is off. |
on | component::Surface | The track's surface while the toggle is on. |
thumb_off | component::Surface | The thumb's surface while the toggle is off. |
thumb_on | component::Surface | The thumb's surface while the toggle is on. |
Trait implementations: Clone, Debug
structaster_ui::component::toggle::ToggleSpec
pub struct ToggleSpec { /* see fields */ }The caller's own plan of one toggle.
Public fields
| field | type | |
|---|---|---|
key | ModelKey | The stable model identity the caller assigns to this toggle. |
caption | Option<component::Label> | The caller's measured caption of the toggle, when it has one. |
track_size | [f64; 2] | The size of the track in logical pixels. |
thumb_size | [f64; 2] | The size of the thumb in logical pixels. |
gap | f64 | The gap between the track and the caption, in logical pixels. |
padding | [f64; 4] | The caller's padding around the whole target: left, top, right, bottom. |
focus_order | Option<u32> | The tab rank of the toggle, when it takes focus. |
Trait implementations: Clone, Debug
Enums
enumaster_ui::component::ActivationError
pub enum ActivationError { NotTarget, Disabled, Busy, NotActivating, Repeated, AlreadyPressed, WrongPointer, NotPressed, Press, Presentation, Input }A typed refusal of a deliberate activation. A refusal never changes the accepted presentation.
Variants
NotTarget— The routed event did not target this control.Disabled— The control is disabled.Busy— The control is busy with another request.NotActivating— The event was not a deliberate activation input.Repeated— A repeated key press was refused.AlreadyPressed— A deliberate press or activation key is already pending.WrongPointer— The release came from a different pointer than the press.NotPressed— No deliberate press or activation key is pending.Press— The press anchor could not be minted, or the press could not complete against the current accepted plane.Presentation— The presentation refused to bind the action.Input— The input router refused the request.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::ButtonState
pub enum ButtonState { Idle, Pressed, Keyed }The deliberate input state of a button.
Variants
Idle— No deliberate press or activation key is pending.Pressed— A primary pointer press is pending on this button.Keyed— An activation key is pending on this button.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::CardError
pub enum CardError { InvalidMetrics, DoesNotFit, Capacity, Scale, Scene }A typed refusal of a card insertion.
A preflight refusal never touched the edit: the edit stays untouched and stays usable. A scene refusal poisoned the edit: the candidate cannot be committed and the edit must be dropped.
Variants
InvalidMetrics— Preflight: the caller's padding, gap, radius or surface is not a usable metric. The core's reason is carried unchanged.DoesNotFit— Preflight: the measured card does not fit the available size.Capacity— Preflight: the card's own nodes do not fit the admitted node capacity.Scale— Preflight: the caller's label was prepared for another output scale.Scene— The scene refused an insert after the card had started inserting.
Trait implementations: Clone, Copy, Debug, Display, Error, PartialEq, StructuralPartialEq
enumaster_ui::component::ControlState
pub enum ControlState { Idle, Hovered, Focused, Pressed, Disabled, Busy }The visual state a control prepares for its surface.
Variants
Idle— Not hovered, focused or pressed.Hovered— The pointer is over the button.Focused— The button holds focus.Pressed— A deliberate press or activation key is pending.Disabled— The button is disabled.Busy— The button is busy with another request.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::EntryRole
pub enum EntryRole { ListItem, Button, Group }The semantic role the caller gives one panel entry.
The role is the caller's own decision. It changes the published semantic description of the entry and the actions the entry publishes, so a caller that changes the role of an entry publishes a different semantic contract with the next acknowledged frame.
Methods
fn role(self) -> Role— The semantic role of the entry.fn actions(self) -> Actions— The actions the entry publishes with the frame.
Variants
ListItem— A navigation entry of a list:Role::ListItem, activatable.Button— A standalone action:Role::Button, activatable and focusable.Group— A plain group:Role::Group, with no action of its own.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::MenuDismiss
pub enum MenuDismiss { Escape, Outside }Why the application should dismiss the menu.
The menu reports the dismissal; the application owns the open state and alone decides what dismissal means.
Variants
Escape— The Escape key was pressed.Outside— A pointer press landed outside the menu, proven by the exact acknowledged hit test.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::MenuError
pub enum MenuError { NoFit, NoSuchItem, Ineligible, WrongItem, Core, Presentation, Activation }A typed refusal of a menu operation. Scene mutation failures require the caller to drop the edit. Completing a gesture can retire its pending intent even when activation is refused; it does not confer application authority.
Variants
NoFit— The measured popup does not fit the caller's viewport. Nothing was inserted and the accepted scene keeps its state.NoSuchItem— The index is not an item of this menu.Ineligible— The item refuses activation: it is disabled, loading or pending.WrongItem— The pointer release belongs to another item than the press, or the action's identity does not belong to the item that was pressed.Core— The scene refused the operation.Presentation— The presentation refused to bind or to revalidate the action.Activation— The row refused the deliberate activation.
Trait implementations: Clone, Copy, Debug, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::MenuOutcome
pub enum MenuOutcome<A> { None, Pressed, Activated, Selection, Dismissed }What a menu event did.
The menu never dispatches backend authority itself: the strongest outcome is an acknowledged action that the application still has to authorize, persist and confirm.
Variants
None— The event did not change the menu.Pressed— A deliberate press started on an eligible item.Activated— The acknowledged activation completed for an item.Selection— The menu's keyboard selection moved to an item.Dismissed— The application should dismiss the menu.
Trait implementations: Debug
enumaster_ui::component::ProgressError
pub enum ProgressError { InvalidValue, InvalidMetrics, DoesNotFit, Capacity, Scene }A typed refusal of a progress control.
A preflight refusal never touched the edit: the edit stays untouched and stays usable. A scene refusal poisoned the edit: the candidate cannot be committed, the edit must be dropped, and the accepted scene keeps its state.
Variants
InvalidValue— Preflight: the caller's progress value is not usable.InvalidMetrics— Preflight: the caller's extent or radius is not a usable metric.DoesNotFit— Preflight: the extent does not fit the available size.Capacity— Preflight: the control's own nodes do not fit the admitted node capacity.Scene— The scene refused an insert after the control had started inserting.
Trait implementations: Clone, Copy, Debug, From<ProgressError>, PartialEq, StructuralPartialEq
enumaster_ui::component::ProgressOrientation
pub enum ProgressOrientation { Horizontal, Vertical }The direction the fill advances in.
Variants
Horizontal— The fill advances along the width, from the left edge.Vertical— The fill advances up the height, from the bottom edge.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::ProgressValue
pub enum ProgressValue { Determinate, Indeterminate }The caller's progress value.
A determinate value is a fraction of the whole task. An indeterminate value is a moving segment whose phase comes from the caller's own clock: the control never reads a clock, never starts a timer and never runs a thread.
Variants
Determinate— A determinate fraction of the whole task.Indeterminate— An indeterminate sweep driven by the caller's clock.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
enumaster_ui::component::RecipeError
pub enum RecipeError { InvalidMetrics, Scale, Capacity, DuplicateKey, Stale, NoFit, Shell, Scene }A typed refusal of a recipe operation.
A refusal never touches the caller's edit: the edit stays untouched and stays usable. A scene refusal poisons the edit: the candidate cannot be committed and the edit must be dropped.
Variants
InvalidMetrics— Preflight: a metric of the plan is not usable.Scale— Preflight: a label was prepared for another output scale.Capacity— Preflight: the panel's own nodes do not fit the admitted capacity.DuplicateKey— Preflight: the plan repeats a model identity.Stale— Preflight: the candidate belongs to an older state of the panel.NoFit— Preflight: the measured panel does not fit the viewport.Shell— The measured shell refused the fit.Scene— The scene refused an insert or a layout change.
Trait implementations: Clone, Copy, Debug, Display, Error, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::RowFit
pub enum RowFit { Fits, TooWide }The measured fit of a row's title in an available width.
Variants
Fits— The measured title fits in the available width.TooWide— The measured title does not fit. The caller must shorten the title or provide its own slot: the row never truncates, ellipsizes or wraps.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
enumaster_ui::component::RowState
pub enum RowState { Idle, Selected, Loading, Disabled, Busy, SelectedDisabled, SelectedLoading, SelectedBusy }The coherent state of a row.
The same state decides the activation gate, the picture and the semantics. A loading row is explicitly read-only: it refuses activation like a busy row and is reported read-only to assistive technology.
Methods
fn is_selected(self) -> bool— Whether the caller identifies this as the selected row, independently of availability. Selection never grants activation authority.fn control_state(state: RowState) -> ControlState— The control state a row's state maps to.fn refuses_activation(state: RowState) -> bool— True while the state refuses activation.
Variants
Idle— Idle and not selected.Selected— The selected item of the list.Loading— The row's content is loading; the row refuses activation.Disabled— The row is disabled and refuses activation.Busy— A request for this row is pending and the row refuses activation.SelectedDisabled— Selected while disabled; selection remains visible but activation refuses.SelectedLoading— Selected while content loads; selection remains visible and read-only.SelectedBusy— Selected while a request is pending; activation refuses as busy.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::ShellColumn
pub enum ShellColumn { Master, Detail }The column a control belongs to.
Variants
Master— The master column: the caller's list.Detail— The detail column: the caller's detail.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::ShellError
pub enum ShellError { InvalidMetrics, MinimumExceedsMeasure, DuplicateControl, ForeignInteraction, Capacity, Scene }A typed refusal of a shell operation. A refusal never touches the scene.
Variants
InvalidMetrics— The caller's metrics are not finite and not negative, or the measured arithmetic overflowed.MinimumExceedsMeasure— A control's minimum size is larger than its measured size.DuplicateControl— The node is already registered with the shell.ForeignInteraction— The interaction belongs to another node.Capacity— The shell already holds its configured number of controls.Scene— The scene refused an insert or a layout change.
Trait implementations: Clone, Copy, Debug, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::ShellFit
pub enum ShellFit { Wide, Narrow, NoFit }The measured fit of a shell in a viewport.
Variants
Wide— The two column layout: the master and the detail are side by side.Narrow— The one column layout: the detail is below the master.NoFit— The measured shell does not fit the viewport. Nothing was mutated.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::Surface
pub enum Surface { None, Paint, Recording }A caller-provided surface: a paint, a painted recording, or nothing.
Variants
None— No surface is painted for this state.Paint— A solid or gradient paint.Recording— A caller-provided painted recording: a material, image or texture.
Trait implementations: Clone, Debug
enumaster_ui::component::TextFieldError
pub enum TextFieldError { InvalidMetrics, Scale, SourceMismatch, HeightChanged, NotEditable, Stale, Multiline, Text, Scene }A typed refusal of a field operation.
Validation performed before scene writes leaves the edit untouched. Errors from the existing Edit operations follow its poisoning contract: discard the failed candidate and do not adopt it. The error variant alone does not prove that an edit is still usable, since scene-description preparation can also fail before any write. Document effects follow the checked document API; they are not rolled back by a later field or scene refusal.
Variants
InvalidMetrics— The caller's metrics or the appearance are not usable.Scale— The prepared run is not the one the field admitted.SourceMismatch— The projected document is not the one the field was given.HeightChanged— The caller's text does not fit the field's own height.NotEditable— The caller asked for something the field does not do.Stale— The candidate does not belong to this field or to its accepted state.Multiline— The document is not a single line.Text— The document or the geometry refused the operation.Scene— A scene description or edit operation was refused. An Edit-operation error poisons the candidate; a preflight description error may precede all writes. Follow the originating operation's contract.
Trait implementations: Clone, Copy, Debug, Display, Error, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::TextFieldState
pub enum TextFieldState { Idle, Focused, Disabled, ReadOnly }The visible state of the field.
The policy is the caller's to apply to its own model; the field only makes it visible: a focused field shows its caret, a read-only field still shows its caret (the text is read-only, the caret is not), and a disabled field shows no caret at all.
Variants
Idle— The field is idle: no caret is shown.Focused— The field holds the focus: the caret is shown.Disabled— The field is disabled: no caret is shown and the edits are refused.ReadOnly— The field is read-only: the caret is shown and the edits are refused.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::adaptive_grid::GridError
pub enum GridError { InvalidMetrics, Capacity, DuplicateNode, OwnedNode, UnknownItem, Scene }Variants
InvalidMetricsCapacityDuplicateNodeOwnedNodeUnknownItemScene
Trait implementations: Clone, Copy, Debug, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::adaptive_grid::GridFit
pub enum GridFit { Fits, NoFit }Variants
FitsNoFit
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
enumaster_ui::component::button::ActivationError
pub enum ActivationError { NotTarget, Disabled, Busy, NotActivating, Repeated, AlreadyPressed, WrongPointer, NotPressed, Press, Presentation, Input }A typed refusal of a deliberate activation. A refusal never changes the accepted presentation.
Variants
NotTarget— The routed event did not target this control.Disabled— The control is disabled.Busy— The control is busy with another request.NotActivating— The event was not a deliberate activation input.Repeated— A repeated key press was refused.AlreadyPressed— A deliberate press or activation key is already pending.WrongPointer— The release came from a different pointer than the press.NotPressed— No deliberate press or activation key is pending.Press— The press anchor could not be minted, or the press could not complete against the current accepted plane.Presentation— The presentation refused to bind the action.Input— The input router refused the request.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::button::ButtonState
pub enum ButtonState { Idle, Pressed, Keyed }The deliberate input state of a button.
Variants
Idle— No deliberate press or activation key is pending.Pressed— A primary pointer press is pending on this button.Keyed— An activation key is pending on this button.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::button::ControlState
pub enum ControlState { Idle, Hovered, Focused, Pressed, Disabled, Busy }The visual state a control prepares for its surface.
Variants
Idle— Not hovered, focused or pressed.Hovered— The pointer is over the button.Focused— The button holds focus.Pressed— A deliberate press or activation key is pending.Disabled— The button is disabled.Busy— The button is busy with another request.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::button::Surface
pub enum Surface { None, Paint, Recording }A caller-provided surface: a paint, a painted recording, or nothing.
Variants
None— No surface is painted for this state.Paint— A solid or gradient paint.Recording— A caller-provided painted recording: a material, image or texture.
Trait implementations: Clone, Debug
enumaster_ui::component::card::CardError
pub enum CardError { InvalidMetrics, DoesNotFit, Capacity, Scale, Scene }A typed refusal of a card insertion.
A preflight refusal never touched the edit: the edit stays untouched and stays usable. A scene refusal poisoned the edit: the candidate cannot be committed and the edit must be dropped.
Variants
InvalidMetrics— Preflight: the caller's padding, gap, radius or surface is not a usable metric. The core's reason is carried unchanged.DoesNotFit— Preflight: the measured card does not fit the available size.Capacity— Preflight: the card's own nodes do not fit the admitted node capacity.Scale— Preflight: the caller's label was prepared for another output scale.Scene— The scene refused an insert after the card had started inserting.
Trait implementations: Clone, Copy, Debug, Display, Error, PartialEq, StructuralPartialEq
enumaster_ui::component::control_input::ControlInputError
pub enum ControlInputError { KeyMismatch, SnapshotMismatch, DuplicateKey, UnknownNode, NotARow, NotAButton, Capacity, Context }A typed refusal of a registration.
A refusal happens before the registry is mutated: the registry stays exactly as it was.
The refusal is a standard [std::error::Error]: its message is concise
and stable, and only [ControlInputError::Context] carries a source.
Variants
KeyMismatch— The acknowledged context does not carry the registered node's own model key: the registration would name a control of another model.SnapshotMismatch— The acknowledged snapshot the registration was made for is not the snapshot of the acknowledged context.DuplicateKey— Another registration already carries this model identity.UnknownNode— The node is not registered.NotARow— The node is registered, but not as a row.NotAButton— The node is registered, but not as a button.Capacity— The group is full: the caller's own bound is reached.Context— The acknowledged context refused the node.
Trait implementations: Clone, Copy, Debug, Display, Error, PartialEq, StructuralPartialEq
enumaster_ui::component::control_input::ControlKind
pub enum ControlKind { Button, Row }What kind of control a registration is.
The kind is part of a registration's identity: the same node with another kind is another control, and the old registration is retired.
Variants
Button— A standalone action button.Row— A list row.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::list_row::RowFit
pub enum RowFit { Fits, TooWide }The measured fit of a row's title in an available width.
Variants
Fits— The measured title fits in the available width.TooWide— The measured title does not fit. The caller must shorten the title or provide its own slot: the row never truncates, ellipsizes or wraps.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
enumaster_ui::component::list_row::RowState
pub enum RowState { Idle, Selected, Loading, Disabled, Busy, SelectedDisabled, SelectedLoading, SelectedBusy }The coherent state of a row.
The same state decides the activation gate, the picture and the semantics. A loading row is explicitly read-only: it refuses activation like a busy row and is reported read-only to assistive technology.
Methods
fn is_selected(self) -> bool— Whether the caller identifies this as the selected row, independently of availability. Selection never grants activation authority.fn control_state(state: RowState) -> ControlState— The control state a row's state maps to.fn refuses_activation(state: RowState) -> bool— True while the state refuses activation.
Variants
Idle— Idle and not selected.Selected— The selected item of the list.Loading— The row's content is loading; the row refuses activation.Disabled— The row is disabled and refuses activation.Busy— A request for this row is pending and the row refuses activation.SelectedDisabled— Selected while disabled; selection remains visible but activation refuses.SelectedLoading— Selected while content loads; selection remains visible and read-only.SelectedBusy— Selected while a request is pending; activation refuses as busy.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::menu::MenuDismiss
pub enum MenuDismiss { Escape, Outside }Why the application should dismiss the menu.
The menu reports the dismissal; the application owns the open state and alone decides what dismissal means.
Variants
Escape— The Escape key was pressed.Outside— A pointer press landed outside the menu, proven by the exact acknowledged hit test.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::menu::MenuError
pub enum MenuError { NoFit, NoSuchItem, Ineligible, WrongItem, Core, Presentation, Activation }A typed refusal of a menu operation. Scene mutation failures require the caller to drop the edit. Completing a gesture can retire its pending intent even when activation is refused; it does not confer application authority.
Variants
NoFit— The measured popup does not fit the caller's viewport. Nothing was inserted and the accepted scene keeps its state.NoSuchItem— The index is not an item of this menu.Ineligible— The item refuses activation: it is disabled, loading or pending.WrongItem— The pointer release belongs to another item than the press, or the action's identity does not belong to the item that was pressed.Core— The scene refused the operation.Presentation— The presentation refused to bind or to revalidate the action.Activation— The row refused the deliberate activation.
Trait implementations: Clone, Copy, Debug, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::menu::MenuOutcome
pub enum MenuOutcome<A> { None, Pressed, Activated, Selection, Dismissed }What a menu event did.
The menu never dispatches backend authority itself: the strongest outcome is an acknowledged action that the application still has to authorize, persist and confirm.
Variants
None— The event did not change the menu.Pressed— A deliberate press started on an eligible item.Activated— The acknowledged activation completed for an item.Selection— The menu's keyboard selection moved to an item.Dismissed— The application should dismiss the menu.
Trait implementations: Debug
enumaster_ui::component::progress::ProgressError
pub enum ProgressError { InvalidValue, InvalidMetrics, DoesNotFit, Capacity, Scene }A typed refusal of a progress control.
A preflight refusal never touched the edit: the edit stays untouched and stays usable. A scene refusal poisoned the edit: the candidate cannot be committed, the edit must be dropped, and the accepted scene keeps its state.
Variants
InvalidValue— Preflight: the caller's progress value is not usable.InvalidMetrics— Preflight: the caller's extent or radius is not a usable metric.DoesNotFit— Preflight: the extent does not fit the available size.Capacity— Preflight: the control's own nodes do not fit the admitted node capacity.Scene— The scene refused an insert after the control had started inserting.
Trait implementations: Clone, Copy, Debug, From<ProgressError>, PartialEq, StructuralPartialEq
enumaster_ui::component::progress::ProgressOrientation
pub enum ProgressOrientation { Horizontal, Vertical }The direction the fill advances in.
Variants
Horizontal— The fill advances along the width, from the left edge.Vertical— The fill advances up the height, from the bottom edge.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::progress::ProgressValue
pub enum ProgressValue { Determinate, Indeterminate }The caller's progress value.
A determinate value is a fraction of the whole task. An indeterminate value is a moving segment whose phase comes from the caller's own clock: the control never reads a clock, never starts a timer and never runs a thread.
Variants
Determinate— A determinate fraction of the whole task.Indeterminate— An indeterminate sweep driven by the caller's clock.
Trait implementations: Clone, Copy, Debug, PartialEq, StructuralPartialEq
enumaster_ui::component::recipe::EntryRole
pub enum EntryRole { ListItem, Button, Group }The semantic role the caller gives one panel entry.
The role is the caller's own decision. It changes the published semantic description of the entry and the actions the entry publishes, so a caller that changes the role of an entry publishes a different semantic contract with the next acknowledged frame.
Methods
fn role(self) -> Role— The semantic role of the entry.fn actions(self) -> Actions— The actions the entry publishes with the frame.
Variants
ListItem— A navigation entry of a list:Role::ListItem, activatable.Button— A standalone action:Role::Button, activatable and focusable.Group— A plain group:Role::Group, with no action of its own.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::recipe::RecipeError
pub enum RecipeError { InvalidMetrics, Scale, Capacity, DuplicateKey, Stale, NoFit, Shell, Scene }A typed refusal of a recipe operation.
A refusal never touches the caller's edit: the edit stays untouched and stays usable. A scene refusal poisons the edit: the candidate cannot be committed and the edit must be dropped.
Variants
InvalidMetrics— Preflight: a metric of the plan is not usable.Scale— Preflight: a label was prepared for another output scale.Capacity— Preflight: the panel's own nodes do not fit the admitted capacity.DuplicateKey— Preflight: the plan repeats a model identity.Stale— Preflight: the candidate belongs to an older state of the panel.NoFit— Preflight: the measured panel does not fit the viewport.Shell— The measured shell refused the fit.Scene— The scene refused an insert or a layout change.
Trait implementations: Clone, Copy, Debug, Display, Error, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::shell::ShellColumn
pub enum ShellColumn { Master, Detail }The column a control belongs to.
Variants
Master— The master column: the caller's list.Detail— The detail column: the caller's detail.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::shell::ShellError
pub enum ShellError { InvalidMetrics, MinimumExceedsMeasure, DuplicateControl, ForeignInteraction, Capacity, Scene }A typed refusal of a shell operation. A refusal never touches the scene.
Variants
InvalidMetrics— The caller's metrics are not finite and not negative, or the measured arithmetic overflowed.MinimumExceedsMeasure— A control's minimum size is larger than its measured size.DuplicateControl— The node is already registered with the shell.ForeignInteraction— The interaction belongs to another node.Capacity— The shell already holds its configured number of controls.Scene— The scene refused an insert or a layout change.
Trait implementations: Clone, Copy, Debug, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::shell::ShellFit
pub enum ShellFit { Wide, Narrow, NoFit }The measured fit of a shell in a viewport.
Variants
Wide— The two column layout: the master and the detail are side by side.Narrow— The one column layout: the detail is below the master.NoFit— The measured shell does not fit the viewport. Nothing was mutated.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::stepper::StepDirection
pub enum StepDirection { Decrement, Increment }Which deliberate operation the caller is proposing.
Variants
Decrement— Propose decreasing the application-owned value.Increment— Propose increasing the application-owned value.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::stepper::StepperError
pub enum StepperError { InvalidGeometry, DuplicateKey, InvalidScale, NoFit, Scene }Why the caller's composition was refused.
Variants
InvalidGeometry— Padding/gap/scale or arithmetic is invalid.DuplicateKey— The three caller-owned identities must be distinct.InvalidScale— A prepared label belongs to another output scale.NoFit— The intrinsic content does not fit; no write was attempted.Scene— Scene edits follow the existing Edit poisoning/rollback contract.
Trait implementations: Clone, Copy, Debug, Display, Error, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::text_field::TextFieldError
pub enum TextFieldError { InvalidMetrics, Scale, SourceMismatch, HeightChanged, NotEditable, Stale, Multiline, Text, Scene }A typed refusal of a field operation.
Validation performed before scene writes leaves the edit untouched. Errors from the existing Edit operations follow its poisoning contract: discard the failed candidate and do not adopt it. The error variant alone does not prove that an edit is still usable, since scene-description preparation can also fail before any write. Document effects follow the checked document API; they are not rolled back by a later field or scene refusal.
Variants
InvalidMetrics— The caller's metrics or the appearance are not usable.Scale— The prepared run is not the one the field admitted.SourceMismatch— The projected document is not the one the field was given.HeightChanged— The caller's text does not fit the field's own height.NotEditable— The caller asked for something the field does not do.Stale— The candidate does not belong to this field or to its accepted state.Multiline— The document is not a single line.Text— The document or the geometry refused the operation.Scene— A scene description or edit operation was refused. An Edit-operation error poisons the candidate; a preflight description error may precede all writes. Follow the originating operation's contract.
Trait implementations: Clone, Copy, Debug, Display, Error, From<Error>, PartialEq, StructuralPartialEq
enumaster_ui::component::text_field::TextFieldState
pub enum TextFieldState { Idle, Focused, Disabled, ReadOnly }The visible state of the field.
The policy is the caller's to apply to its own model; the field only makes it visible: a focused field shows its caret, a read-only field still shows its caret (the text is read-only, the caret is not), and a disabled field shows no caret at all.
Variants
Idle— The field is idle: no caret is shown.Focused— The field holds the focus: the caret is shown.Disabled— The field is disabled: no caret is shown and the edits are refused.ReadOnly— The field is read-only: the caret is shown and the edits are refused.
Trait implementations: Clone, Copy, Debug, Eq, PartialEq, StructuralPartialEq
enumaster_ui::component::toggle::ToggleError
pub enum ToggleError { InvalidGeometry, NoFit, Scene }A typed refusal of a toggle.
Variants
InvalidGeometry— The geometry is not usable: a value is not finite, not positive, the thumb does not fit the track, or the measured arithmetic overflowed.NoFit— The measured target does not fit the layout the caller admits.Scene— The scene refused the toggle.
Trait implementations: Clone, Copy, Debug, Display, Error, From<Error>, PartialEq, StructuralPartialEq
Traits
traitaster_ui::component::ControlContext
pub trait ControlContextThe acknowledged binding a control drives against.
The application presentation and the read-only acknowledged context both satisfy it, so a native callback can drive the same control without holding the presentation and without a second router. The proof itself is the core's: this trait only delegates to it and adds nothing.
Required and provided methods
fn anchor_press(&self, node: NodeId, pointer: Option<PointerId>) -> Result<PressAnchor, PressError>— Anchors a deliberate press against the acknowledged plane. A pointer press carries its pointer; a deliberate key press carriesNone.fn anchor_key(&self, node: NodeId) -> Result<PressAnchor, PressError>— Anchors a deliberate key press, with no pointer and no position.fn continuity_press(&self, anchor: &PressAnchor, position: DevicePoint) -> Result<(), PressError>— Proves that a deliberate pointer press may still complete, against the current accepted plane only.fn continuity_key(&self, anchor: &PressAnchor) -> Result<(), PressError>— Proves that a deliberate key press may still complete, against the current accepted plane and the current focus.
traitaster_ui::component::MenuContext
pub trait MenuContextThe acknowledged binding a menu drives against.
It is the existing [ControlContext] plus the exact acknowledged hit test.
The hit test is what makes an outside click provable: the menu asks the
acknowledged plane where the pointer actually landed and never guesses a
rectangle of its own.
Required and provided methods
fn hit(&self, point: DevicePoint) -> Result<Option<HitTarget>, Error>— The exact acknowledged hit test at a device point, filtered by the acknowledged policies.
traitaster_ui::component::button::ControlContext
pub trait ControlContextThe acknowledged binding a control drives against.
The application presentation and the read-only acknowledged context both satisfy it, so a native callback can drive the same control without holding the presentation and without a second router. The proof itself is the core's: this trait only delegates to it and adds nothing.
Required and provided methods
fn anchor_press(&self, node: NodeId, pointer: Option<PointerId>) -> Result<PressAnchor, PressError>— Anchors a deliberate press against the acknowledged plane. A pointer press carries its pointer; a deliberate key press carriesNone.fn anchor_key(&self, node: NodeId) -> Result<PressAnchor, PressError>— Anchors a deliberate key press, with no pointer and no position.fn continuity_press(&self, anchor: &PressAnchor, position: DevicePoint) -> Result<(), PressError>— Proves that a deliberate pointer press may still complete, against the current accepted plane only.fn continuity_key(&self, anchor: &PressAnchor) -> Result<(), PressError>— Proves that a deliberate key press may still complete, against the current accepted plane and the current focus.
traitaster_ui::component::menu::MenuContext
pub trait MenuContextThe acknowledged binding a menu drives against.
It is the existing [ControlContext] plus the exact acknowledged hit test.
The hit test is what makes an outside click provable: the menu asks the
acknowledged plane where the pointer actually landed and never guesses a
rectangle of its own.
Required and provided methods
fn hit(&self, point: DevicePoint) -> Result<Option<HitTarget>, Error>— The exact acknowledged hit test at a device point, filtered by the acknowledged policies.
Functions
fnaster_ui::component::label::measured_text
pub fn measured_text(shaper: &mut TextShaper, run: TextRun<'_>, style: TextStyle) -> Result<Label, Error>Measures a real text run with the existing shaper and prepares its painted content.
The advance and the line height come from the shaped run and the font metrics of the caller's own font. The baseline is the caller's baseline offset inside the label box; the kit never guesses one.
The font metrics measure the ascent above the baseline and the descent
below it, so a baseline that keeps the whole measured line inside the
advertised box lies in [ascent, ascent + line_gap]. A baseline outside
that range is refused before anything is recorded: the kit never clamps,
crops or moves a glyph to make a label fit.
fnaster_ui::component::text_field::validate_single_line
pub fn validate_single_line(text: &str) -> Result<(), TextFieldError>Checks this plain field's single-line grammar without shaping, editing or allocating. Empty text and tabs are allowed; seven line/paragraph separators are refused. Callers bound payloads before this linear scan. This does not admit ownership, capacity, focus, policy or secret safety.
Constants
constaster_ui::component::PROGRESS_COMMAND_COUNT
pub const PROGRESS_COMMAND_COUNT: usizeThe exact number of recording commands a progress control contributes.
The count is zero. The control paints with the caller's own paint or with the caller's own prepared recording, so the recording budget of the scene stays the caller's own budget and the control never spends any of it.
constaster_ui::component::PROGRESS_NODE_COUNT
pub const PROGRESS_NODE_COUNT: usizeThe exact number of scene nodes a progress control inserts.
The count is the root, the track and the fill. It is exact: the control never inserts a node it does not report, and an update never inserts a node at all.
constaster_ui::component::progress::PROGRESS_COMMAND_COUNT
pub const PROGRESS_COMMAND_COUNT: usizeThe exact number of recording commands a progress control contributes.
The count is zero. The control paints with the caller's own paint or with the caller's own prepared recording, so the recording budget of the scene stays the caller's own budget and the control never spends any of it.
constaster_ui::component::progress::PROGRESS_NODE_COUNT
pub const PROGRESS_NODE_COUNT: usizeThe exact number of scene nodes a progress control inserts.
The count is the root, the track and the fill. It is exact: the control never inserts a node it does not report, and an update never inserts a node at all.
constaster_ui::component::toggle::MINIMUM_SIZE
pub const MINIMUM_SIZE: f64The smallest target a toggle may have, in logical pixels.
The target is the box of a deliberate press, so the derived size is never smaller than this on either side.