Skip to main content

UiSession

Struct UiSession 

Source
pub struct UiSession { /* private fields */ }
Expand description

Owns the complete retained UI state for one native window.

A backend may be recreated or switched without replacing this session, so component, input, layout and scene identities survive renderer lifecycle changes.

Implementations§

Source§

impl UiSession

Source

pub fn new() -> Self

Source

pub fn runtime(&self) -> &UiRuntime

Source

pub fn runtime_mut(&mut self) -> &mut UiRuntime

Source

pub fn invalidations_mut(&mut self) -> &mut InvalidationSet

Source

pub fn render_tree(&self) -> HostTree

Source

pub fn prepare_render(&mut self, viewport: UiRect, scale: UiScale)

Source

pub fn replace_tree(&mut self, tree: HostTree)

Source

pub fn tree(&self) -> &HostTree

Source

pub fn has_tree(&self) -> bool

Source

pub fn handle_input(&mut self, input: InputEvent) -> RuntimeOutput

Source

pub fn advance(&mut self, elapsed_ms: f32) -> RuntimeOutput

Source

pub fn handle_default_action( &mut self, action: UiDefaultAction, ) -> RuntimeOutput

Source

pub fn commit(&mut self, viewport: UiRect) -> HostCommit

Source

pub fn render_view( &mut self, view: &AppView, viewport: UiRect, scale: UiScale, ) -> HostCommit

Source

pub fn apply_pending_updates(&mut self) -> PendingUpdateOutput

Source

pub fn layout_metrics(&self) -> LayoutCommitMetrics

Source

pub fn component_metrics(&self) -> ComponentRuntimeMetrics

Source

pub fn projection_metrics(&self) -> HostProjectionMetrics

Source

pub fn invalidate_all(&mut self)

Source

pub fn clear_host(&mut self)

Source

pub fn reset(&mut self)

Source

pub fn set_wake(&self, wake: UiWake)

Source

pub fn set_task_spawner(&mut self, spawner: UiTaskSpawner)

Trait Implementations§

Source§

impl Default for UiSession

Source§

fn default() -> UiSession

Returns the “default value” for a type. Read more
Source§

impl InputSink for UiSession

Auto Trait Implementations§

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.