pub struct Executor<K: QueueKey> { /* private fields */ }Expand description
The priority executor: single-thread polling + class vruntime selection.
Implementations§
Source§impl<K: QueueKey> Executor<K>
impl<K: QueueKey> Executor<K>
Sourcepub fn new(
options: ExecutorOptions,
queues: Vec<Queue<K>>,
) -> Result<Rc<Self>, String>
pub fn new( options: ExecutorOptions, queues: Vec<Queue<K>>, ) -> Result<Rc<Self>, String>
Create an executor with N classes, each with a weight (share).
Sourcepub fn queue(self: &Rc<Self>, qid: K) -> Result<QueueHandle<K>, SpawnError<K>>
pub fn queue(self: &Rc<Self>, qid: K) -> Result<QueueHandle<K>, SpawnError<K>>
Get a handle to a queue through which tasks can be spawned
Sourcepub async fn run_until<F: Future>(&self, until: F) -> F::Output
pub async fn run_until<F: Future>(&self, until: F) -> F::Output
Run the executor loop until the given future completes.
Panic behavior: if any task panics while being polled, the executor
panics (propagates) unless executor has been configured to catch panics
with with_panic_on_task_panic(false).
The executor will continue running tasks until until completes, then
returns. When the executor stops, pending tasks remain pending and will
resume if run_until is called again (Tokio-like behavior).
Auto Trait Implementations§
impl<K> !Freeze for Executor<K>
impl<K> !RefUnwindSafe for Executor<K>
impl<K> !Send for Executor<K>
impl<K> !Sync for Executor<K>
impl<K> Unpin for Executor<K>where
K: Unpin,
impl<K> !UnwindSafe for Executor<K>
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