Skip to main content

Executor

Struct Executor 

Source
pub struct Executor<F: Future<Output = ()>> { /* private fields */ }
Expand description

A single-threaded FILL executor over tasks of type F.

Implementations§

Source§

impl<F: Future<Output = ()>> Executor<F>

Source

pub fn new() -> Self

No tasks.

Source

pub fn spawn(&mut self, fut: F)

Add a task; it is polled on the next run.

Source

pub fn unfinished(&self) -> usize

Tasks not yet finished.

Source

pub fn run<C: Clock, I: Idle>( &mut self, reactor: &Reactor<'_, C>, idle: &mut I, park_bound: DurNs, ) -> Result<RunStats>

Run every task to completion. When none is ready the thread idles in idle as reactor decides; a single park lasts at most park_bound.

§Errors

Stalled: tasks remain and nothing can wake them.

Trait Implementations§

Source§

impl<F: Future<Output = ()>> Default for Executor<F>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<F> Forget for Executor<F>

§

impl<F> Freeze for Executor<F>
where Vec<Task<F>>: Freeze,

§

impl<F> Move for Executor<F>

§

impl<F> RefUnwindSafe for Executor<F>
where Vec<Task<F>>: RefUnwindSafe,

§

impl<F> Send for Executor<F>
where Vec<Task<F>>: Send,

§

impl<F> Sync for Executor<F>
where Vec<Task<F>>: Sync,

§

impl<F> Unpin for Executor<F>
where Vec<Task<F>>: Unpin,

§

impl<F> UnsafeUnpin for Executor<F>
where Vec<Task<F>>: UnsafeUnpin,

§

impl<F> UnwindSafe for Executor<F>
where Vec<Task<F>>: UnwindSafe,

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.