pub struct Executor<'a, const C: usize, M, S = Local> { /* 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 Monitor 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 implementation for Monitor based on condvar, compatible with Rust STD (for cases where notifying from / running in ISRs is not important).
    • Out of the box implementation for Monitor based on WASM event loop, compatible with WASM

Implementations

Trait Implementations

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

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.