pub struct Node { /* private fields */ }
Expand description
A node in the UI tree with event delegation support
Implementations§
Source§impl Node
impl Node
Sourcepub fn new(component: Option<ComponentInstance>) -> Self
pub fn new(component: Option<ComponentInstance>) -> Self
Create a new node
Sourcepub fn children_mut(&mut self) -> &mut Vec<Node>
pub fn children_mut(&mut self) -> &mut Vec<Node>
Get the node’s children mutably
Sourcepub fn event_delegate(&self) -> Option<Arc<Mutex<EventDelegate>>>
pub fn event_delegate(&self) -> Option<Arc<Mutex<EventDelegate>>>
Get the node’s event delegate
Sourcepub fn add_attribute(&mut self, key: String, value: String)
pub fn add_attribute(&mut self, key: String, value: String)
Add an attribute
Sourcepub fn dispatch_event<E: Event + Clone + 'static>(&self, event: &E)
pub fn dispatch_event<E: Event + Clone + 'static>(&self, event: &E)
Dispatch an event to this node
Sourcepub fn component(&self) -> Option<&ComponentInstance>
pub fn component(&self) -> Option<&ComponentInstance>
Get the component instance
Sourcepub fn component_mut(&mut self) -> Option<&mut ComponentInstance>
pub fn component_mut(&mut self) -> Option<&mut ComponentInstance>
Get the component instance mutably
Sourcepub fn attributes(&self) -> &HashMap<String, String>
pub fn attributes(&self) -> &HashMap<String, String>
Get attributes
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Node
impl !RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Event for T
impl<T> Event for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to Any for downcasting (mutable)
Source§fn event_type(&self) -> &'static str
fn event_type(&self) -> &'static str
Get the event type name
Source§impl<T> Props for T
impl<T> Props for T
Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert to mutable Any for downcasting