[−][src]Struct pixel_widgets::Ui
Entry point for pixel-widgets.
Ui
manages a Model
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:
Implementations
impl<M: Model, E: EventLoop<Command<M::Message>>, L: Loader> Ui<M, E, L>
[src]
pub fn new(model: M, event_loop: E, loader: L, viewport: Rectangle) -> Self
[src]
Constructs a new Ui
using the default style.
This is not recommended as the default style is very empty and only renders white text.
pub async fn set_stylesheet<U: AsRef<str>, '_>(
&'_ mut self,
url: U
) -> Result<(), Error>
[src]
&'_ mut self,
url: U
) -> Result<(), Error>
Constructs a new Ui
asynchronously by first fetching a stylesheet from a
.pwss data source.
pub fn reload_stylesheet<U: 'static + AsRef<str> + Send>(&mut self, url: U)
[src]
Replace the current stylesheet with a new one
pub fn graphics(&self) -> Graphics<L>
[src]
Get a Graphics
loader
pub fn resize(&mut self, viewport: Rectangle)
[src]
Resizes the viewport. This forces the view to be rerendered.
pub fn command(&mut self, command: Command<M::Message>)
[src]
Updates the model after a Command
has resolved.
pub fn update(&mut self, message: M::Message)
[src]
Updates the model with a message. This forces the view to be rerendered.
pub fn event(&mut self, event: Event)
[src]
Handles an Event
.
pub fn needs_redraw(&self) -> bool
[src]
Returns true if the ui needs to be redrawn. If the ui doesn't need to be redrawn the
Command
s from the last draw
may be used again.
pub fn draw(&mut self) -> DrawList
[src]
Generate a DrawList
for the view.
Trait Implementations
impl<M: Model, E: EventLoop<Command<M::Message>>, L: Loader> Deref for Ui<M, E, L>
[src]
impl<M: Model, E: EventLoop<Command<M::Message>>, L: Loader> DerefMut for Ui<M, E, L>
[src]
Auto Trait Implementations
impl<M, E, L> !RefUnwindSafe for Ui<M, E, L>
impl<M, E, L> !Send for Ui<M, E, L>
impl<M, E, L> !Sync for Ui<M, E, L>
impl<M, E, L> Unpin for Ui<M, E, L> where
E: Unpin,
E: Unpin,
impl<M, E, L> !UnwindSafe for Ui<M, E, L>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SetParameter for T
fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
T: Parameter<Self>,
T: Parameter<Self>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,