pub struct UiDispatcher { /* private fields */ }Expand description
Posts work from any thread to the UI thread of a runtime.
Implementations§
Source§impl UiDispatcher
impl UiDispatcher
Sourcepub fn post(&self, task: impl FnOnce() + Send + 'static)
pub fn post(&self, task: impl FnOnce() + Send + 'static)
Queues task to run on the UI thread the next time the runtime drains UI work. May be
called from any thread.
Sourcepub fn post_invoke<T>(&self, id: u64, value: T)where
T: Send + 'static,
pub fn post_invoke<T>(&self, id: u64, value: T)where
T: Send + 'static,
Queues a call of the continuation registered under id with value, to run on the UI
thread. May be called from any thread.
Sourcepub fn has_pending(&self) -> bool
pub fn has_pending(&self) -> bool
Returns true if a posted message has not run yet.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for UiDispatcher
impl !UnwindSafe for UiDispatcher
impl Freeze for UiDispatcher
impl Send for UiDispatcher
impl Sync for UiDispatcher
impl Unpin for UiDispatcher
impl UnsafeUnpin for UiDispatcher
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