pub struct SemanticNode {
pub id: Id,
pub role: Role,
pub label: Option<String>,
pub rect: Rect,
pub children: Vec<Id>,
pub focused: bool,
pub disabled: bool,
pub value: Option<f32>,
pub min_value: Option<f32>,
pub max_value: Option<f32>,
}Expand description
A node in the semantic/accessibility tree. This exists independently of the draw order and describes the “meaning” of the UI.
Fields§
§id: IdThe unique, persistent ID of the widget.
role: RoleThe semantic role of the widget.
label: Option<String>The human-readable label or description (e.g. Button text).
rect: RectThe screen-space bounding box.
children: Vec<Id>The IDs of children nodes in the semantic hierarchy.
focused: boolWhether this node is currently focused by the keyboard.
disabled: boolWhether this node is currently disabled (non-interactive).
value: Option<f32>Current numeric value (for sliders, progress bars, etc).
min_value: Option<f32>Minimum numeric value.
max_value: Option<f32>Maximum numeric value.
Implementations§
Source§impl SemanticNode
impl SemanticNode
pub fn new(id: Id, role: Role, rect: Rect) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_focus(self, focused: bool) -> Self
pub fn with_value(self, value: f32) -> Self
pub fn with_min_value(self, min: f32) -> Self
pub fn with_max_value(self, max: f32) -> Self
Trait Implementations§
Source§impl Clone for SemanticNode
impl Clone for SemanticNode
Source§fn clone(&self) -> SemanticNode
fn clone(&self) -> SemanticNode
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticNode
impl Debug for SemanticNode
Source§impl PartialEq for SemanticNode
impl PartialEq for SemanticNode
Source§fn eq(&self, other: &SemanticNode) -> bool
fn eq(&self, other: &SemanticNode) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SemanticNode
Auto Trait Implementations§
impl Freeze for SemanticNode
impl RefUnwindSafe for SemanticNode
impl Send for SemanticNode
impl Sync for SemanticNode
impl Unpin for SemanticNode
impl UnsafeUnpin for SemanticNode
impl UnwindSafe for SemanticNode
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
Mutably borrows from an owned value. Read more