pub struct Element {
pub kind: String,
pub id: Option<String>,
pub path: String,
pub props: BTreeMap<String, Prop>,
pub template: Option<Template>,
pub children: Vec<Node>,
pub action: Option<Action>,
pub source: SourceLocation,
}Fields§
§kind: StringBuilt-in component name from spec::COMPONENTS.
id: Option<String>Control identity for interactive components.
path: StringStructural path inside the declaring component, stable for a build.
props: BTreeMap<String, Prop>§template: Option<Template>§children: Vec<Node>§action: Option<Action>§source: SourceLocationImplementations§
Source§impl Element
impl Element
pub fn prop(&self, name: &str) -> Option<&Prop>
The items of its ContextMenu, dividers among them, if it has one.
Sourcepub fn has_content(&self) -> bool
pub fn has_content(&self) -> bool
Whether it has children to show besides a ContextMenu.
pub fn keyword(&self, name: &str) -> Option<&str>
pub fn number(&self, name: &str) -> Option<f64>
pub fn text(&self, name: &str) -> Option<&Text>
pub fn icon(&self, name: &str) -> Option<&str>
pub fn resource(&self, name: &str) -> Option<&str>
Sourcepub fn clearing(&self) -> Option<Action>
pub fn clearing(&self) -> Option<Action>
What follows the element’s action: with submit: clear on a
TextInput, or clears: draft.x on a Button, the draft becomes
empty, and the keyboard goes back to the window.
pub fn field(&self, name: &str) -> Option<&FieldRef>
pub fn expr(&self, name: &str) -> Option<&Expr>
pub fn query(&self, name: &str) -> Option<&QueryBinding>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Element
impl<'de> Deserialize<'de> for Element
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Element
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnsafeUnpin for Element
impl UnwindSafe for Element
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