[][src]Struct pixel_widgets::Ui

pub struct Ui<M: Model, E: EventLoop<Command<M::Message>>, L: Loader> { /* fields omitted */ }

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: 'static + EventLoop<Command<M::Message>>, L: 'static + 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]

Constructs a new Ui asynchronously by first fetching a stylesheet from a .pwss data source.

pub fn replace_stylesheet(&mut self, style: Arc<Style>)[src]

Replace the current stylesheet with a loaded new stylesheet

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 Commands 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]

type Target = M

The resulting type after dereferencing.

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> where
    E: RefUnwindSafe,
    L: RefUnwindSafe,
    M: RefUnwindSafe
[src]

impl<M, E, L> Send for Ui<M, E, L> where
    M: Send
[src]

impl<M, E, L> Sync for Ui<M, E, L> where
    E: Sync,
    M: Sync
[src]

impl<M, E, L> Unpin for Ui<M, E, L> where
    E: Unpin
[src]

impl<M, E, L> UnwindSafe for Ui<M, E, L> where
    E: UnwindSafe,
    L: RefUnwindSafe,
    M: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.