pub struct Semantics {
pub typ: WidgetType,
pub label: String,
pub value: Option<f64>,
pub selected: Option<bool>,
pub enabled: bool,
}Expand description
The semantic payload attached to a painted element — what role it plays, the
human/agent-readable label, an optional numeric value, and whether it is the
current selection. This is the data a screen reader announces and a robot
driver / get_by_label retrieves.
Fields§
§typ: WidgetTypeAccessKit role (egui maps WidgetType → accesskit::Role).
label: StringStable, human-readable label. MUST be unique within a surface (FC-5).
value: Option<f64>Optional numeric value (a grid cell number, a bar height, a node count,
a yaw angle). Becomes the AccessKit numeric_value.
selected: Option<bool>Whether this element is the current selection (a selected cell/row/node).
enabled: boolWhether the element is enabled/interactive.
Implementations§
Source§impl Semantics
impl Semantics
Sourcepub fn new(typ: WidgetType, label: impl Into<String>) -> Self
pub fn new(typ: WidgetType, label: impl Into<String>) -> Self
A labelled element of an arbitrary role (no value, no selection).
A clickable button (e.g. a painted graph/DAG node, a chip, a tile).
Sourcepub fn image(label: impl Into<String>) -> Self
pub fn image(label: impl Into<String>) -> Self
A value-bearing image/region summary (e.g. a whole map/plot pane).
Sourcepub fn list_item(label: impl Into<String>, selected: bool) -> Self
pub fn list_item(label: impl Into<String>, selected: bool) -> Self
A selectable list/row item (file row, command-palette row, menu item).
Sourcepub fn value(self, v: f64) -> Self
pub fn value(self, v: f64) -> Self
Attach a numeric value (chainable). Carried as AccessKit numeric_value,
so get_by_label(..).numeric_value() reads it back exactly.
Sourcepub fn widget_info(&self) -> WidgetInfo
pub fn widget_info(&self) -> WidgetInfo
Build the egui WidgetInfo this semantics maps to.
Trait Implementations§
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§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more