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.

Handles a ui Event.

If the ui has any pending futures internally, they are polled using the waker. Returns output messages from the root component if the event 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.

Returns true if the ui needs to be redrawn. If the ui doesn’t need to be redrawn the Commands from the last draw may be used again.

Generate a DrawList for the view.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.