#[repr(u8)]pub enum DispatchStrategy {
Inline = 0,
Deferred = 1,
FromIsr = 2,
}Expand description
How a Node expects its callbacks to fire.
Variants§
Inline = 0
Callbacks fire from the executor’s spin loop (current default).
Served by every runtime: POSIX, RTOS (FreeRTOS/NuttX/Zephyr/
ThreadX), bare-metal, RTIC (proxied via __nros_dispatch task
when the board demands it), Embassy (likewise). The default for
every existing Node pkg — preserves backward compat.
Deferred = 1
Callbacks fire from a framework-owned task (RTIC dispatcher /
Embassy task). The board-side NodeDispatchRuntime enqueues
signaled callbacks; the framework’s scheduler dequeues + drives
ExecutableNode::on_callback from its own task context. Needed
for Nodes whose callbacks must not run from the spin task (e.g.
callbacks that take RTIC locks or share priority with custom
tasks).
FromIsr = 2
Callbacks fire directly from an ISR handler. Design slot only —
impl deferred to Phase 216.E.1. Requires a reentrancy audit of
the dispatch path + a lock-free SPSC variant tolerant of
ISR-priority producers + a per-Node #[isr_safe] proof
contract. Reserved here so the matrix in Phase 216.D.1 has a
stable discriminant to reject against.
Implementations§
Source§impl DispatchStrategy
impl DispatchStrategy
Sourcepub const DEFAULT: DispatchStrategy = Self::Inline
pub const DEFAULT: DispatchStrategy = Self::Inline
Compile-time default for Node::DISPATCH. Inline preserves
every existing Node pkg unchanged.
Sourcepub const fn to_u8(self) -> u8
pub const fn to_u8(self) -> u8
FFI round-trip discriminant. Mirrors as u8 but expressible in
const contexts where as casts on enums currently require an
#[allow(non_upper_case_globals)] dance.
Sourcepub const fn from_u8(value: u8) -> Option<DispatchStrategy>
pub const fn from_u8(value: u8) -> Option<DispatchStrategy>
Inverse of to_u8. Returns None for unknown discriminants —
nros check surfaces the rejection with a clear diagnostic
rather than silently treating a future strategy as Inline.
Trait Implementations§
Source§impl Clone for DispatchStrategy
impl Clone for DispatchStrategy
Source§fn clone(&self) -> DispatchStrategy
fn clone(&self) -> DispatchStrategy
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more