pub struct Semantics {Show 41 fields
pub role: Role,
pub label: Option<String>,
pub identifier: Option<String>,
pub value: Option<String>,
pub actions: ActionSet,
pub action_scope_id: Option<u128>,
pub focusable: bool,
pub multiline: bool,
pub masked: bool,
pub input_mask: Option<InputMask>,
pub ime_preedit_range: Option<(usize, usize)>,
pub checked: Option<bool>,
pub disabled: bool,
pub read_only: bool,
pub autofocus: bool,
pub draggable: bool,
pub scrollable_x: bool,
pub scrollable_y: bool,
pub min_value: Option<f32>,
pub max_value: Option<f32>,
pub current_value: Option<f32>,
pub is_focus_scope: bool,
pub is_focus_barrier: bool,
pub drag_payload: Option<Vec<u8>>,
pub hero_tag: Option<String>,
pub focus_index: Option<i32>,
pub text_input_type: TextInputType,
pub text_input_action: TextInputAction,
pub text_capitalization: TextCapitalization,
pub max_length: Option<usize>,
pub max_length_enforcement: MaxLengthEnforcement,
pub input_formatters: Vec<InputFormatter>,
pub autocorrect: bool,
pub enable_suggestions: bool,
pub spell_check: bool,
pub smart_dashes: bool,
pub smart_quotes: bool,
pub autofill_hints: Vec<String>,
pub scroll_padding: Option<[f32; 4]>,
pub capture_tab: bool,
pub auto_indent: bool,
}Expand description
Accessibility and interaction metadata for a node.
Semantics is the IR’s way of describing what a node means rather than how it
looks or where it is positioned. It is consumed by:
- Assistive technology (screen readers, switch control) via the accessibility tree.
- The event/focus system, which uses
focusable,actions, anddisabledto route input. - The drag-and-drop subsystem, which reads
draggableanddrag_payload.
Most fields default to “inert” values (see Default impl), so you only need to
set the fields that matter for a given widget.
§Example
use fission_ir::Semantics;
use fission_ir::semantics::Role;
let sem = Semantics {
role: Role::Button,
label: Some("Submit".into()),
focusable: true,
..Semantics::default()
};Fields§
§role: RoleThe accessibility role. Defaults to Role::Generic.
label: Option<String>A human-readable label for assistive technology (e.g., “Close” for a button).
identifier: Option<String>Stable semantic identifier for tooling and automation.
value: Option<String>The current value as a string (e.g., the text in an input field).
actions: ActionSetThe set of actions this node responds to.
action_scope_id: Option<u128>Optional raw action dispatch scope inherited by descendant actions.
focusable: boolWhether this node can receive keyboard focus.
multiline: boolWhether this text input supports multiple lines.
masked: boolWhether the value should be obscured (password fields).
input_mask: Option<InputMask>An optional input mask that restricts which characters are accepted.
ime_preedit_range: Option<(usize, usize)>The byte range of IME pre-edit (composition) text, if any.
checked: Option<bool>For checkboxes and switches: Some(true) = checked, Some(false) = unchecked,
None = not a toggle.
disabled: boolWhether the node is disabled (grayed out, non-interactive).
read_only: boolWhether the node can be focused and selected but not edited.
autofocus: boolWhether this node should receive focus automatically when mounted.
draggable: boolWhether this node can be dragged.
scrollable_x: boolWhether the node scrolls horizontally.
scrollable_y: boolWhether the node scrolls vertically.
min_value: Option<f32>Minimum value for range inputs (sliders).
max_value: Option<f32>Maximum value for range inputs (sliders).
current_value: Option<f32>Current numeric value for range inputs (sliders).
is_focus_scope: boolWhen true, this node creates a new focus scope (like a dialog or panel).
is_focus_barrier: boolWhen true, Tab traversal does not leave this subtree.
drag_payload: Option<Vec<u8>>Serialized payload attached to a drag operation.
hero_tag: Option<String>An identifier for hero/shared-element transitions.
focus_index: Option<i32>Explicit tab order index. Lower values receive focus first. None means
the node follows document order.
text_input_type: TextInputTypePreferred keyboard/input modality for text entry.
text_input_action: TextInputActionPreferred submit/return key action.
text_capitalization: TextCapitalizationAutomatic capitalization strategy for inserted text.
max_length: Option<usize>Maximum number of Unicode scalar values allowed in the field.
max_length_enforcement: MaxLengthEnforcementWhether max_length should be enforced during editing.
input_formatters: Vec<InputFormatter>Structured input formatters applied to inserted text.
autocorrect: boolHint to the platform IME whether autocorrect should be enabled.
enable_suggestions: boolHint to the platform IME whether suggestions should be enabled.
spell_check: boolHint to the platform IME whether spell checking should be enabled.
smart_dashes: boolHint to the platform IME whether smart dashes should be enabled.
smart_quotes: boolHint to the platform IME whether smart quotes should be enabled.
autofill_hints: Vec<String>Platform autofill categories associated with this field.
scroll_padding: Option<[f32; 4]>Extra padding to keep around the caret/selection when auto-scrolling [left, right, top, bottom].
capture_tab: boolWhen true, Tab key inserts spaces instead of moving focus.
auto_indent: boolWhen true, Enter copies leading whitespace from the current line.