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. InternalLower 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.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Semantics
impl<'de> Deserialize<'de> for Semantics
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Semantics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Semantics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Semantics
impl Serialize for Semantics
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Semantics
Auto Trait Implementations§
impl Freeze for Semantics
impl RefUnwindSafe for Semantics
impl Send for Semantics
impl Sync for Semantics
impl Unpin for Semantics
impl UnsafeUnpin for Semantics
impl UnwindSafe for Semantics
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.