pub struct Component { /* private fields */ }Expand description
组件系统相关功能 组件结构体
Implementations§
Source§impl Component
impl Component
Sourcepub fn new(
component_type: ComponentType,
id: &str,
style: Style,
properties: ComponentProperties,
) -> Self
pub fn new( component_type: ComponentType, id: &str, style: Style, properties: ComponentProperties, ) -> Self
Sourcepub fn get_child_mut(&mut self, id: &str) -> Option<&mut Component>
pub fn get_child_mut(&mut self, id: &str) -> Option<&mut Component>
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Sourcepub fn set_visible(&mut self, visible: bool)
pub fn set_visible(&mut self, visible: bool)
Sourcepub fn set_checked(&mut self, checked: bool)
pub fn set_checked(&mut self, checked: bool)
Sourcepub fn set_value(&mut self, value: JsonValueNode)
pub fn set_value(&mut self, value: JsonValueNode)
Sourcepub fn component_type(&self) -> &ComponentType
pub fn component_type(&self) -> &ComponentType
Sourcepub fn properties(&self) -> &ComponentProperties
pub fn properties(&self) -> &ComponentProperties
Sourcepub fn properties_mut(&mut self) -> &mut ComponentProperties
pub fn properties_mut(&mut self) -> &mut ComponentProperties
Sourcepub fn children_mut(&mut self) -> &mut Vec<Component>
pub fn children_mut(&mut self) -> &mut Vec<Component>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnsafeUnpin for Component
impl UnwindSafe for Component
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