pub struct Widget {
pub kind: String,
pub props: Element,
pub children: Vec<Widget>,
}Expand description
One widget: its type, property elements and child widgets.
Fields§
§kind: String§props: Element§children: Vec<Widget>Implementations§
Source§impl Widget
impl Widget
Sourcepub fn group_link(&self) -> Option<GroupLink>
pub fn group_link(&self) -> Option<GroupLink>
The widget’s <group_link>, if it has one.
Source§impl Widget
impl Widget
pub fn from_element(el: Element) -> Self
pub fn f64(&self, name: &str) -> Option<f64>
pub fn i64(&self, name: &str) -> Option<i64>
Sourcepub fn bool(&self, name: &str) -> Option<bool>
pub fn bool(&self, name: &str) -> Option<bool>
A boolean property, parsed as Phoebus’s BooleanWidgetProperty
does; anything else, such as a rule’s output expression giving 5,
is invalid and the widget uses its default.
pub fn color(&self, name: &str) -> Option<Color>
pub fn font(&self, name: &str) -> Option<Font>
pub fn name(&self) -> &str
Sourcepub fn items(&self) -> Vec<String>
pub fn items(&self) -> Vec<String>
<items><item>…</item></items>, as used by combo and choice widgets.
Sourcepub fn list(&self, outer: &str, inner: &str) -> Vec<String>
pub fn list(&self, outer: &str, inner: &str) -> Vec<String>
Texts of <outer><inner>…</inner>…</outer>.
Sourcepub fn points(&self) -> Vec<(f64, f64)>
pub fn points(&self) -> Vec<(f64, f64)>
Points of a polyline or polygon, relative to the widget.
pub fn actions(&self) -> Vec<Action>
pub fn rules(&self) -> Vec<Rule>
pub fn has_scripts(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Widget
impl RefUnwindSafe for Widget
impl Send for Widget
impl Sync for Widget
impl Unpin for Widget
impl UnsafeUnpin for Widget
impl UnwindSafe for Widget
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