pub struct RuntimeHandle { /* private fields */ }Implementations§
Source§impl RuntimeHandle
impl RuntimeHandle
pub fn id(&self) -> RuntimeId
pub fn schedule(&self)
pub fn enqueue_node_update( &self, command: Box<dyn FnMut(&mut dyn Applier) -> Result<(), NodeError> + 'static>, )
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 cancel_frame_callback(&self, id: u64)
pub fn drain_frame_callbacks(&self, frame_time_nanos: u64)
pub fn frame_clock(&self) -> FrameClock
pub fn set_needs_frame(&self, value: bool)
pub fn has_updates(&self) -> bool
pub fn has_invalid_scopes(&self) -> bool
pub fn has_frame_callbacks(&self) -> bool
pub fn assert_ui_thread(&self)
pub fn dispatcher(&self) -> UiDispatcher
Trait Implementations§
Source§impl Clone for RuntimeHandle
impl Clone for RuntimeHandle
Source§fn clone(&self) -> RuntimeHandle
fn clone(&self) -> RuntimeHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RuntimeHandle
impl !RefUnwindSafe for RuntimeHandle
impl !Send for RuntimeHandle
impl !Sync for RuntimeHandle
impl Unpin for RuntimeHandle
impl !UnwindSafe for RuntimeHandle
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