pub struct Executor<'a, const C: usize, N, W, S = Sendable> { /* private fields */ }
Expand description

WORK IN PROGRESS Executor is an async executor that is useful specfically for embedded environments.

The implementation is in fact a thin wrapper around smol’s async-task crate.

Highlights:

  • no_std (but does need alloc; for a no_std and “no_alloc” executor, look at Embassy, which statically pre-allocates all tasks); (note also that usage of alloc is very limited - only when a new task is being spawn, as well as the executor itself);
  • Does not assume an RTOS and can run completely bare-metal (or on top of an RTOS);
  • Pluggable Wait & Notify mechanism which makes it ISR-friendly. In particular:
    • Tasks can be woken up (and thus re-scheduled) from within an ISR;
    • The executor itself can run not just in the main “thread”, but from within an ISR as well; the latter is important for bare-metal non-RTOS use-cases, as it allows - by running multiple executors - one in the main “thread” and the others - on ISR interrupts - to achieve RTOS-like pre-emptive execution by scheduling higher-priority tasks in executors that run on (higher-level) ISRs and thus pre-empt the executors scheduled on lower-level ISR and the “main thread” one; note that deploying an executor in an ISR requires the allocator to be usable from an ISR (i.e. allocation/deallocation routines should be protected by critical sections that disable/enable interrupts);
    • Out of the box implementations for Wait & Notify based on condvars, compatible with Rust STD (for cases where notifying from / running in ISRs is not important).

Implementations

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.