pub struct DispatcherTaskScheduler { /* private fields */ }Expand description
Runs futures on a Dispatcher at a fixed priority: every poll of a
future started here is a dispatcher job of that priority.
Obtained from Dispatcher::to_task_scheduler or
FerroSynchronizationContext::to_task_scheduler.
Implementations§
Source§impl DispatcherTaskScheduler
impl DispatcherTaskScheduler
pub fn dispatcher(&self) -> &Arc<Dispatcher> ⓘ
pub fn priority(&self) -> DispatcherPriority
Sourcepub fn spawn<Fut>(&self, future: Fut) -> DispatcherTask<Fut::Output> ⓘ
pub fn spawn<Fut>(&self, future: Fut) -> DispatcherTask<Fut::Output> ⓘ
Runs future on the dispatcher thread. Can be called from any
thread.
Sourcepub fn spawn_local<Fut>(&self, future: Fut) -> DispatcherTask<Fut::Output> ⓘ
pub fn spawn_local<Fut>(&self, future: Fut) -> DispatcherTask<Fut::Output> ⓘ
Runs a future that is not Send on the dispatcher thread.
§Panics
Panics when called from a thread other than the dispatcher thread.
Sourcepub fn start_local<Fut>(&self, future: Fut) -> DispatcherTask<Fut::Output> ⓘ
pub fn start_local<Fut>(&self, future: Fut) -> DispatcherTask<Fut::Output> ⓘ
Starts a future that is not Send on the dispatcher thread the way
calling an asynchronous method does: the future is polled for the
first time before this returns, so it runs up to its first pending
await right away (and the returned task is already complete if there
is none). Afterwards it is resumed from dispatcher jobs at the
priority of the context.
§Panics
Panics when called from a thread other than the dispatcher thread.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DispatcherTaskScheduler
impl RefUnwindSafe for DispatcherTaskScheduler
impl Send for DispatcherTaskScheduler
impl Sync for DispatcherTaskScheduler
impl Unpin for DispatcherTaskScheduler
impl UnsafeUnpin for DispatcherTaskScheduler
impl UnwindSafe for DispatcherTaskScheduler
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
Source§impl<T> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
affects_render, metadata
overrides). Read more