pub struct BackgroundExecutor { /* private fields */ }Implementations§
Source§impl BackgroundExecutor
impl BackgroundExecutor
pub fn new(scheduler: Arc<dyn Scheduler>) -> Self
pub fn spawn<F>(&self, future: F) -> Task<F::Output> ⓘ
pub fn spawn_with_priority<F>( &self, priority: Priority, future: F, ) -> Task<F::Output> ⓘ
Sourcepub fn spawn_realtime<F>(&self, future: F) -> Task<F::Output> ⓘ
pub fn spawn_realtime<F>(&self, future: F) -> Task<F::Output> ⓘ
Spawns a future on a dedicated realtime thread for audio processing.
pub fn timer(&self, duration: Duration) -> Timer ⓘ
pub fn now(&self) -> Instant
pub fn scheduler(&self) -> &Arc<dyn Scheduler>
Sourcepub fn spawn_dedicated<F, Fut>(&self, f: F) -> Task<Fut::Output> ⓘ
pub fn spawn_dedicated<F, Fut>(&self, f: F) -> Task<Fut::Output> ⓘ
Spawn a closure on a fresh session pinned to its own LocalExecutor.
The closure runs on a new OS thread under PlatformScheduler, or on
the test scheduler’s loop under TestScheduler.
The returned Task represents the dedicated work: dropping it cancels
the dedicated closure, .awaiting it yields the closure’s return
value, .detach()ing it lets the dedicated work run independently of
the caller.
Trait Implementations§
Source§impl Clone for BackgroundExecutor
impl Clone for BackgroundExecutor
Source§fn clone(&self) -> BackgroundExecutor
fn clone(&self) -> BackgroundExecutor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 !RefUnwindSafe for BackgroundExecutor
impl !UnwindSafe for BackgroundExecutor
impl Freeze for BackgroundExecutor
impl Send for BackgroundExecutor
impl Sync for BackgroundExecutor
impl Unpin for BackgroundExecutor
impl UnsafeUnpin for BackgroundExecutor
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