[][src]Struct iced_native::program::State

pub struct State<P> where
    P: Program + 'static, 
{ /* fields omitted */ }

The execution state of a Program. It leverages caching, event processing, and rendering primitive storage.

Methods

impl<P> State<P> where
    P: Program + 'static, 
[src]

pub fn new(
    program: P,
    bounds: Size,
    cursor_position: Point,
    renderer: &mut P::Renderer,
    debug: &mut Debug
) -> Self
[src]

Creates a new State with the provided Program, initializing its primitive with the given logical bounds and renderer.

pub fn program(&self) -> &P[src]

Returns a reference to the Program of the State.

pub fn primitive(&self) -> &<P::Renderer as Renderer>::Output[src]

Returns a reference to the current rendering primitive of the State.

pub fn queue_event(&mut self, event: Event)[src]

Queues an event in the State for processing during an update.

pub fn queue_message(&mut self, message: P::Message)[src]

Queues a message in the State for processing during an update.

pub fn is_queue_empty(&self) -> bool[src]

Returns whether the event queue of the State is empty or not.

pub fn next_animation(&self) -> AnimationState[src]

Returns the soonest moment the event loop needs to animate.

pub fn update(
    &mut self,
    bounds: Size,
    cursor_position: Point,
    clipboard: Option<&dyn Clipboard>,
    renderer: &mut P::Renderer,
    debug: &mut Debug
) -> Option<Command<P::Message>>
[src]

Processes all the queued events and messages, rebuilding and redrawing the widgets of the linked Program if necessary.

Returns the [Command] obtained from Program after updating it, only if an update was necessary.

Auto Trait Implementations

impl<P> RefUnwindSafe for State<P> where
    P: RefUnwindSafe,
    <P as Program>::Message: RefUnwindSafe,
    <<P as Program>::Renderer as Renderer>::Output: RefUnwindSafe

impl<P> Send for State<P> where
    P: Send,
    <P as Program>::Message: Send,
    <<P as Program>::Renderer as Renderer>::Output: Send

impl<P> Sync for State<P> where
    P: Sync,
    <P as Program>::Message: Sync,
    <<P as Program>::Renderer as Renderer>::Output: Sync

impl<P> Unpin for State<P> where
    P: Unpin,
    <P as Program>::Message: Unpin,
    <<P as Program>::Renderer as Renderer>::Output: Unpin

impl<P> UnwindSafe for State<P> where
    P: UnwindSafe,
    <P as Program>::Message: UnwindSafe,
    <<P as Program>::Renderer as Renderer>::Output: UnwindSafe

Blanket Implementations

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

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, U> Into<U> for T where
    U: From<T>, 
[src]

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]