pub struct ComponentModel {
pub id: String,
pub component_type: String,
pub properties: Map<String, Value>,
}Expand description
Represents one component in the flat component map.
Fields§
§id: StringUnique component ID within the surface.
component_type: StringComponent type name (e.g. “Text”, “Button”, “Column”).
properties: Map<String, Value>All component properties as raw JSON (type-specific).
Implementations§
Source§impl ComponentModel
impl ComponentModel
Sourcepub fn from_json(value: &Value) -> Result<Self, A2uiError>
pub fn from_json(value: &Value) -> Result<Self, A2uiError>
Parse from a raw JSON value.
Extracts id and component fields, puts the rest into properties.
Sourcepub fn get_property<T: DeserializeOwned>(&self, key: &str) -> Option<T>
pub fn get_property<T: DeserializeOwned>(&self, key: &str) -> Option<T>
Get a typed property value.
Sourcepub fn min_height(&self) -> Option<u16>
pub fn min_height(&self) -> Option<u16>
Get the minHeight property — a total-footprint height floor (incl. margins/borders).
Used by the measure pass to enforce a minimum vertical size regardless of the
component’s natural content height. CamelCase key matches the existing protocol
convention (activeTab, enableDate, displayStyle).
Sourcepub fn accessibility(&self) -> Option<AccessibilityAttributes>
pub fn accessibility(&self) -> Option<AccessibilityAttributes>
Get the accessibility attributes for this component.
Trait Implementations§
Source§impl Clone for ComponentModel
impl Clone for ComponentModel
Source§fn clone(&self) -> ComponentModel
fn clone(&self) -> ComponentModel
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 moreAuto Trait Implementations§
impl Freeze for ComponentModel
impl RefUnwindSafe for ComponentModel
impl Send for ComponentModel
impl Sync for ComponentModel
impl Unpin for ComponentModel
impl UnsafeUnpin for ComponentModel
impl UnwindSafe for ComponentModel
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