[−][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: '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]
&mut self,
url: U
) -> Result<(), Error>
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
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> where
E: RefUnwindSafe,
L: RefUnwindSafe,
M: RefUnwindSafe,
[src]
E: RefUnwindSafe,
L: RefUnwindSafe,
M: RefUnwindSafe,
impl<M, E, L> Send for Ui<M, E, L> where
M: Send,
[src]
M: Send,
impl<M, E, L> Sync for Ui<M, E, L> where
E: Sync,
M: Sync,
[src]
E: Sync,
M: Sync,
impl<M, E, L> Unpin for Ui<M, E, L> where
E: Unpin,
[src]
E: Unpin,
impl<M, E, L> UnwindSafe for Ui<M, E, L> where
E: UnwindSafe,
L: RefUnwindSafe,
M: UnwindSafe,
[src]
E: UnwindSafe,
L: RefUnwindSafe,
M: UnwindSafe,
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
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.
pub 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>,