Skip to main content

AppRunner

Struct AppRunner 

Source
pub struct AppRunner<W, R>
where W: Widget, R: Renderer,
{ /* private fields */ }
Expand description

v0.1 runtime runner. It intentionally manages exactly one widget instance lifetime. Timers and tasks are instance-owned and are shut down with stop/dispose.

Implementations§

Source§

impl<W, R> AppRunner<W, R>
where W: Widget, R: Renderer,

Source

pub fn new(widget_name: impl Into<String>, widget: W, renderer: R) -> Self

Source

pub fn widget_name(&self) -> &str

Source

pub fn surface_size(&self) -> Size

Source

pub fn set_surface_size(&mut self, size: Size)

Source

pub fn attach_waker<F>(&mut self, wake: F)
where F: Fn() + Send + Sync + 'static,

Source

pub fn initialize(&mut self, surface_size: Size) -> Result<()>

Source

pub fn process_pending(&mut self) -> Result<()>

Source

pub fn handle_host_event(&mut self, event: HostEvent) -> Result<()>

Source

pub fn needs_redraw(&self) -> bool

Source

pub fn render(&mut self, surface: &mut dyn RenderSurface) -> Result<()>

Source

pub fn shutdown(&mut self) -> Result<()>

Trait Implementations§

Source§

impl<W, R> Drop for AppRunner<W, R>
where W: Widget, R: Renderer,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<W, R> Freeze for AppRunner<W, R>
where W: Freeze, R: Freeze, <W as Widget>::State: Freeze,

§

impl<W, R> !RefUnwindSafe for AppRunner<W, R>

§

impl<W, R> Send for AppRunner<W, R>
where <W as Widget>::State: Send,

§

impl<W, R> !Sync for AppRunner<W, R>

§

impl<W, R> Unpin for AppRunner<W, R>
where W: Unpin, R: Unpin, <W as Widget>::State: Unpin, <W as Widget>::Message: Unpin,

§

impl<W, R> UnsafeUnpin for AppRunner<W, R>

§

impl<W, R> !UnwindSafe for AppRunner<W, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.