Skip to main content

ComponentModel

Struct ComponentModel 

Source
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: String

Unique component ID within the surface.

§component_type: String

Component type name (e.g. “Text”, “Button”, “Column”).

§properties: Map<String, Value>

All component properties as raw JSON (type-specific).

Implementations§

Source§

impl ComponentModel

Source

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.

Source

pub fn get_property<T: DeserializeOwned>(&self, key: &str) -> Option<T>

Get a typed property value.

Source

pub fn get_raw(&self, key: &str) -> Option<&Value>

Get a raw property value.

Source

pub fn children(&self) -> Option<ChildList>

Get the children property as a ChildList.

Source

pub fn child(&self) -> Option<String>

Get the child property as a single ComponentId.

Source

pub fn action(&self) -> Option<Action>

Get the action property.

Source

pub fn weight(&self) -> Option<f64>

Get the weight property.

Source

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).

Source

pub fn checks(&self) -> Option<Vec<CheckRule>>

Get the checks property.

Source

pub fn accessibility(&self) -> Option<AccessibilityAttributes>

Get the accessibility attributes for this component.

Trait Implementations§

Source§

impl Clone for ComponentModel

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for ComponentModel

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.