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
impl UiSession
pub fn new() -> Self
pub fn runtime(&self) -> &UiRuntime
pub fn runtime_mut(&mut self) -> &mut UiRuntime
pub fn invalidations_mut(&mut self) -> &mut InvalidationSet
pub fn render_tree(&self) -> HostTree
pub fn prepare_render(&mut self, viewport: UiRect, scale: UiScale)
pub fn replace_tree(&mut self, tree: HostTree)
pub fn tree(&self) -> &HostTree
pub fn has_tree(&self) -> bool
pub fn handle_input(&mut self, input: InputEvent) -> RuntimeOutput
pub fn advance(&mut self, elapsed_ms: f32) -> RuntimeOutput
pub fn handle_default_action( &mut self, action: UiDefaultAction, ) -> RuntimeOutput
pub fn commit(&mut self, viewport: UiRect) -> HostCommit
pub fn render_view( &mut self, view: &AppView, viewport: UiRect, scale: UiScale, ) -> HostCommit
pub fn apply_pending_updates(&mut self) -> PendingUpdateOutput
pub fn layout_metrics(&self) -> LayoutCommitMetrics
pub fn component_metrics(&self) -> ComponentRuntimeMetrics
pub fn projection_metrics(&self) -> HostProjectionMetrics
pub fn invalidate_all(&mut self)
pub fn clear_host(&mut self)
pub fn reset(&mut self)
pub fn set_wake(&self, wake: UiWake)
pub fn set_task_spawner(&mut self, spawner: UiTaskSpawner)
Trait Implementations§
Source§impl InputSink for UiSession
impl InputSink for UiSession
fn handle_input(&mut self, input: InputEvent) -> RuntimeOutput
Auto Trait Implementations§
impl !Freeze for UiSession
impl !RefUnwindSafe for UiSession
impl !Send for UiSession
impl !Sync for UiSession
impl !UnwindSafe for UiSession
impl Unpin for UiSession
impl UnsafeUnpin for UiSession
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more