Skip to main content

TierExecutorBacking

Struct TierExecutorBacking 

Source
pub struct TierExecutorBacking<const N: usize> { /* private fields */ }
Expand description

issue 1571 — the spawned tiers’ executor backing. nros::main! emits one TierExecutorBacking static per tiered entry and hands its slots to the board’s run_tiers, which refuses a short block through check_tier_executor_backing and opens each spawned tier with Executor::open_with_session_slot. Gated like the module it names (has_rmw + alloc in nros-node). issue 1571 — the spawned tiers’ executor backing, N slots in ONE named static that the ENTRY owns.

nros::main! emits one per tiered entry, with N = the tier count minus the boot tier (which takes the EXECUTOR_BACKING road), and passes take to the board’s run_tiers. The board then refuses a short block with check_tier_executor_backing — the Rust twin of the C library’s nros_cpp_executor_storage_check.

Placement is the caller’s (RFC-0002 § 4.4b): the static lives in the entry’s .bss, so mem-report prices it by name.

Implementations§

Source§

impl<const N: usize> TierExecutorBacking<N>

Source

pub const fn new() -> TierExecutorBacking<N>

An untouched reservation. const so it can initialise a static, and uninitialised (plus a false latch), so the static is all-zero .bss and costs no flash.

large_stack_arrays is allowed because this is only ever evaluated in CONST context (a static initialiser): the array is built by the compiler into .bss, never on a stack.

Source

pub fn take(&'static self) -> &'static mut [[MaybeUninit<u64>; 11071]]

Hand out every slot, once. A second call returns an EMPTY slice, which the board’s check_tier_executor_backing then refuses by name rather than aliasing a slot another executor is using.

mut_from_ref is the point, not an accident: &'static self is how a static is reached, and the latch is what makes the one &mut sound — the same shape as the boot reservation’s take.

Trait Implementations§

Source§

impl<const N: usize> Sync for TierExecutorBacking<N>

Auto Trait Implementations§

§

impl<const N: usize> !Freeze for TierExecutorBacking<N>

§

impl<const N: usize> !RefUnwindSafe for TierExecutorBacking<N>

§

impl<const N: usize> Send for TierExecutorBacking<N>

§

impl<const N: usize> Unpin for TierExecutorBacking<N>

§

impl<const N: usize> UnsafeUnpin for TierExecutorBacking<N>

§

impl<const N: usize> UnwindSafe for TierExecutorBacking<N>

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 = Infallible

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

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

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.