pub struct RuntimeHandle { /* private fields */ }Implementations§
Source§impl RuntimeHandle
impl RuntimeHandle
pub fn id(&self) -> RuntimeId
pub fn state_arena_stats(&self) -> (usize, usize)
pub fn state_arena_debug_stats(&self) -> StateArenaDebugStats
pub fn debug_stats(&self) -> RuntimeDebugStats
pub fn live_ui_task_labels(&self) -> Vec<(u64, String)>
pub fn schedule(&self)
Sourcepub fn enqueue_ui_task(&self, task: Box<dyn FnOnce() + 'static>)
pub fn enqueue_ui_task(&self, task: Box<dyn FnOnce() + 'static>)
Schedules work that must run on the runtime thread.
The closure executes on the UI thread immediately when the runtime
drains its local queue, so it may capture Rc/RefCell values. Calling
this from any other thread is a logic error and will panic in debug
builds via the inner assertion.
pub fn spawn_ui<F>(&self, fut: F) -> Option<TaskHandle>
pub fn cancel_task(&self, id: u64)
Sourcepub fn post_ui(&self, task: impl FnOnce() + Send + 'static)
pub fn post_ui(&self, task: impl FnOnce() + Send + 'static)
Enqueues work from any thread to run on the UI thread.
The closure must be Send because it may cross threads before executing
on the runtime thread. Use this when posting from background work.
pub fn register_ui_cont<T: 'static>( &self, f: impl FnOnce(T) + 'static, ) -> Option<u64>
pub fn cancel_ui_cont(&self, id: u64)
pub fn drain_ui(&self)
pub fn has_pending_ui(&self) -> bool
pub fn register_frame_callback( &self, callback: impl FnOnce(u64) + 'static, ) -> Option<u64>
pub fn register_perpetual_frame_callback( &self, callback: impl FnOnce(u64) + 'static, ) -> Option<u64>
pub fn cancel_frame_callback(&self, id: u64)
Sourcepub fn drain_frame_callbacks(&self, frame_time_nanos: u64)
pub fn drain_frame_callbacks(&self, frame_time_nanos: u64)
Delivers callbacks registered before this display frame. Timestamps use one monotonic nanosecond epoch; duplicate or older timestamps are ignored. A callback registered during delivery waits for a newer frame timestamp.
Sourcepub fn last_frame_time_nanos(&self) -> Option<u64>
pub fn last_frame_time_nanos(&self) -> Option<u64>
Animation-clock time of the most recent frame-callback drain (see
Runtime::last_frame_time_nanos).
pub fn frame_clock(&self) -> FrameClock
pub fn set_needs_frame(&self, value: bool)
pub fn has_updates(&self) -> bool
Sourcepub fn forget_movable(&self, id: Key)
pub fn forget_movable(&self, id: Key)
Releases the retained state of the movable content with identity
id at the composition’s next opportunity. See
crate::forget_movable.