Struct pixel_widgets::Ui [−][src]
pub struct Ui<M: 'static + Component> { /* fields omitted */ }
Expand description
Entry point for the user interface.
Ui
manages a root Component
and processes it to a
DrawList
that can be rendered using your own renderer implementation.
Alternatively, you can use one of the following included wrappers:
Async support
Components can submit futures to the Context
using
wait()
and
stream()
. These futures will update
those components when they complete or yield messages.
To support this, you must make sure that the poll method on Ui
is called appropriately
since the Ui
can’t be submitted to a typical executor.
The Sandbox
can serve as an example since it
provides such a runtime for you through the winit event loop.
Implementations
Constructs a new Ui
. Returns an error if the style fails to load.
Updates the root component with a message.
If the ui has any pending futures internally, they are polled using the waker. Returns output messages from the root component if the update or the poll yielded any.
It’s up to the user to make sure that the waker
will schedule a call to poll()
on this Ui
.
If the ui has any pending futures internally, this method will poll them using the waker. Returns output messages from the root component if the poll yielded any.
It’s up to the user to make sure that the waker
will schedule another call to poll()
.
Resizes the viewport. This forces the view to be rerendered.