RuntimeHandle

Struct RuntimeHandle 

Source
pub struct RuntimeHandle { /* private fields */ }

Implementations§

Source§

impl RuntimeHandle

Source

pub fn id(&self) -> RuntimeId

Source

pub fn schedule(&self)

Source

pub fn enqueue_node_update( &self, command: Box<dyn FnMut(&mut dyn Applier) -> Result<(), NodeError> + 'static>, )

Source

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.

Source

pub fn spawn_ui<F>(&self, fut: F) -> Option<TaskHandle>
where F: Future<Output = ()> + 'static,

Source

pub fn cancel_task(&self, id: u64)

Source

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.

Source

pub fn register_ui_cont<T: 'static>( &self, f: impl FnOnce(T) + 'static, ) -> Option<u64>

Source

pub fn cancel_ui_cont(&self, id: u64)

Source

pub fn drain_ui(&self)

Source

pub fn has_pending_ui(&self) -> bool

Source

pub fn register_frame_callback( &self, callback: impl FnOnce(u64) + 'static, ) -> Option<u64>

Source

pub fn cancel_frame_callback(&self, id: u64)

Source

pub fn drain_frame_callbacks(&self, frame_time_nanos: u64)

Source

pub fn frame_clock(&self) -> FrameClock

Source

pub fn set_needs_frame(&self, value: bool)

Source

pub fn has_updates(&self) -> bool

Source

pub fn has_invalid_scopes(&self) -> bool

Source

pub fn has_frame_callbacks(&self) -> bool

Source

pub fn assert_ui_thread(&self)

Source

pub fn dispatcher(&self) -> UiDispatcher

Trait Implementations§

Source§

impl Clone for RuntimeHandle

Source§

fn clone(&self) -> RuntimeHandle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.