pub struct Ui<E, M>where
E: 'static,
M: 'static,{ /* private fields */ }
Expand description
A Ui
is a container for related widgets.
Implementations§
source§impl<E, M> Ui<E, M>
impl<E, M> Ui<E, M>
sourcepub fn new<D, W>(new_data: D, new_root_widget: W) -> (Self, Id)
pub fn new<D, W>(new_data: D, new_root_widget: W) -> (Self, Id)
Create a new Ui
instance containing one widget that acts as the
root widget.
sourcepub fn add_ui_widget<D, W>(
&mut self,
parent: Id,
new_data: D,
new_widget: W
) -> Id
pub fn add_ui_widget<D, W>( &mut self, parent: Id, new_data: D, new_widget: W ) -> Id
Add a widget to the Ui
.
This method fulfills the exact same purpose as
MutCap::add_widget
, but it does not require boxing up the
provided FnOnce
.
Trait Implementations§
source§impl<E, M> Cap for Ui<E, M>
impl<E, M> Cap for Ui<E, M>
source§fn children(&self, widget: Id) -> Iter<'_, Id> ⓘ
fn children(&self, widget: Id) -> Iter<'_, Id> ⓘ
Retrieve an iterator over the children. Iteration happens in z-order, from highest to lowest.
source§fn is_visible(&self, widget: Id) -> bool
fn is_visible(&self, widget: Id) -> bool
Check whether a widget has its visibility flag set.
source§fn is_displayed(&self, widget: Id) -> bool
fn is_displayed(&self, widget: Id) -> bool
Check whether a widget is actually being displayed.
source§fn is_focused(&self, widget: Id) -> bool
fn is_focused(&self, widget: Id) -> bool
Check whether the given widget is focused.
source§impl<E, M> MutCap<E, M> for Ui<E, M>
impl<E, M> MutCap<E, M> for Ui<E, M>
source§fn data_mut(&mut self, widget: Id) -> &mut dyn Any
fn data_mut(&mut self, widget: Id) -> &mut dyn Any
Retrieve a mutable reference to a widget’s data.
source§fn add_widget(
&mut self,
parent: Id,
new_data: Box<dyn FnOnce() -> Box<dyn Any>>,
new_widget: Box<dyn FnOnce(Id, &mut dyn MutCap<E, M>) -> Box<dyn Widget<E, M>>>
) -> Id
fn add_widget( &mut self, parent: Id, new_data: Box<dyn FnOnce() -> Box<dyn Any>>, new_widget: Box<dyn FnOnce(Id, &mut dyn MutCap<E, M>) -> Box<dyn Widget<E, M>>> ) -> Id
Add a widget to the Ui
.
source§fn hook_events(
&mut self,
widget: Id,
hook_fn: Option<&'static dyn for<'f> Fn(&'f dyn Widget<E, M>, &'f mut dyn MutCap<E, M>, Option<&'f E>) -> Pin<Box<dyn Future<Output = Option<E>> + 'f>>>
) -> Option<&'static dyn for<'f> Fn(&'f dyn Widget<E, M>, &'f mut dyn MutCap<E, M>, Option<&'f E>) -> Pin<Box<dyn Future<Output = Option<E>> + 'f>>>where
E: Mergeable,
fn hook_events(
&mut self,
widget: Id,
hook_fn: Option<&'static dyn for<'f> Fn(&'f dyn Widget<E, M>, &'f mut dyn MutCap<E, M>, Option<&'f E>) -> Pin<Box<dyn Future<Output = Option<E>> + 'f>>>
) -> Option<&'static dyn for<'f> Fn(&'f dyn Widget<E, M>, &'f mut dyn MutCap<E, M>, Option<&'f E>) -> Pin<Box<dyn Future<Output = Option<E>> + 'f>>>where
E: Mergeable,
Install or remove an event hook handler.
source§fn send<'life0, 'async_trait>(
&'life0 mut self,
widget: Id,
message: M
) -> Pin<Box<dyn Future<Output = Option<M>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn send<'life0, 'async_trait>(
&'life0 mut self,
widget: Id,
message: M
) -> Pin<Box<dyn Future<Output = Option<M>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send the provided message to the given widget.
source§fn call<'life0, 'life1, 'async_trait>(
&'life0 mut self,
widget: Id,
message: &'life1 mut M
) -> Pin<Box<dyn Future<Output = Option<M>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn call<'life0, 'life1, 'async_trait>(
&'life0 mut self,
widget: Id,
message: &'life1 mut M
) -> Pin<Box<dyn Future<Output = Option<M>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send the provided message to the given widget, without transferring ownership of the message.
Auto Trait Implementations§
impl<E, M> !RefUnwindSafe for Ui<E, M>
impl<E, M> !Send for Ui<E, M>
impl<E, M> !Sync for Ui<E, M>
impl<E, M> Unpin for Ui<E, M>
impl<E, M> !UnwindSafe for Ui<E, M>
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