Struct InterruptExecutor

Source
pub struct InterruptExecutor<const SWI: u8> { /* private fields */ }
Expand description

Interrupt mode executor.

This executor runs tasks in interrupt mode. The interrupt handler is set up to poll tasks, and when a task is woken the interrupt is pended from software.

Implementations§

Source§

impl<const SWI: u8> InterruptExecutor<SWI>

Source

pub const fn new(interrupt: SoftwareInterrupt<SWI>) -> Self

Create a new InterruptExecutor. This takes the software interrupt to be used internally.

Source

pub fn start(&'static mut self, priority: Priority) -> SendSpawner

Start the executor at the given priority level.

This initializes the executor, enables the interrupt, and returns. The executor keeps running in the background through the interrupt.

This returns a SendSpawner you can use to spawn tasks on it. A SendSpawner is returned instead of a Spawner because the executor effectively runs in a different “thread” (the interrupt), so spawning tasks on it is effectively sending them.

To obtain a Spawner for this executor, use Spawner::for_current_executor from a task running in it.

Source

pub fn spawner(&'static self) -> SendSpawner

Get a SendSpawner for this executor

This returns a SendSpawner you can use to spawn tasks on this executor.

This MUST only be called on an executor that has already been started. The function will panic otherwise.

Trait Implementations§

Source§

impl<const SWI: u8> Send for InterruptExecutor<SWI>

Source§

impl<const SWI: u8> Sync for InterruptExecutor<SWI>

Auto Trait Implementations§

§

impl<const SWI: u8> !Freeze for InterruptExecutor<SWI>

§

impl<const SWI: u8> !RefUnwindSafe for InterruptExecutor<SWI>

§

impl<const SWI: u8> Unpin for InterruptExecutor<SWI>

§

impl<const SWI: u8> !UnwindSafe for InterruptExecutor<SWI>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

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

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.