pub struct ComponentSchema {
pub component_type: String,
pub id: Option<String>,
pub class_name: Option<String>,
pub style: Option<Value>,
pub visible: Option<Value>,
pub children: Vec<ComponentSchema>,
pub events: Option<EventHandlers>,
pub props: HashMap<String, Value>,
}Expand description
Enhanced component schema for JSON-described UI.
Fields§
§component_type: StringComponent type (e.g., “Container”, “Button”, “Form”).
id: Option<String>Unique identifier for the component.
class_name: Option<String>CSS class names.
style: Option<Value>Inline CSS styles.
visible: Option<Value>Visibility condition (boolean or expression).
children: Vec<ComponentSchema>Child components.
events: Option<EventHandlers>Event handlers.
props: HashMap<String, Value>All other component-specific properties.
Implementations§
Source§impl ComponentSchema
impl ComponentSchema
Sourcepub fn with_child(self, child: ComponentSchema) -> Self
pub fn with_child(self, child: ComponentSchema) -> Self
Add a child component.
Trait Implementations§
Source§impl Clone for ComponentSchema
impl Clone for ComponentSchema
Source§fn clone(&self) -> ComponentSchema
fn clone(&self) -> ComponentSchema
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ComponentSchema
impl Debug for ComponentSchema
Source§impl<'de> Deserialize<'de> for ComponentSchema
impl<'de> Deserialize<'de> for ComponentSchema
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
Auto Trait Implementations§
impl Freeze for ComponentSchema
impl RefUnwindSafe for ComponentSchema
impl Send for ComponentSchema
impl Sync for ComponentSchema
impl Unpin for ComponentSchema
impl UnwindSafe for ComponentSchema
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