pub struct Components { /* private fields */ }Expand description
Store a list of components currently in the tree
Implementations§
Source§impl Components
impl Components
pub fn new() -> Self
pub fn push( &mut self, component_id: ComponentBlueprintId, widget_id: WidgetId, state_id: StateId, accept_ticks: bool, )
pub fn try_remove(&mut self, widget_id: WidgetId)
Sourcepub fn get(&mut self, index: usize) -> Option<(WidgetId, StateId)>
pub fn get(&mut self, index: usize) -> Option<(WidgetId, StateId)>
Get the component by its index
Sourcepub fn get_by_component_id(
&mut self,
id: ComponentBlueprintId,
) -> Option<&CompEntry>
pub fn get_by_component_id( &mut self, id: ComponentBlueprintId, ) -> Option<&CompEntry>
This is used to send messages to components.
The ComponentBlueprintId is only available to components that were added
as a singular component, not prototypes
Sourcepub fn get_by_widget_id(&mut self, id: WidgetId) -> Option<(WidgetId, StateId)>
pub fn get_by_widget_id(&mut self, id: WidgetId) -> Option<(WidgetId, StateId)>
Get the component by its widget id
Sourcepub fn get_ticking(&self, index: usize) -> Option<(WidgetId, StateId)>
pub fn get_ticking(&self, index: usize) -> Option<(WidgetId, StateId)>
Get widget id and state id for a component that accepts tick events
pub fn iter(&self) -> impl Iterator<Item = &CompEntry>
pub fn len(&self) -> usize
Auto Trait Implementations§
impl Freeze for Components
impl RefUnwindSafe for Components
impl Send for Components
impl Sync for Components
impl Unpin for Components
impl UnsafeUnpin for Components
impl UnwindSafe for Components
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