Skip to main content

CallerInboxStorage

Struct CallerInboxStorage 

Source
pub struct CallerInboxStorage<const SLOT_BYTES: usize, const DEPTH: usize> { /* private fields */ }
Expand description

Backing storage for one queryable’s request ring: DEPTH slots of SLOT_BYTES bytes, plus one InboxEntry each.

Declared as a static by the family that knows its own bound – for the ROS parameter services that is nros-node, the only crate that can see both the contract’s declared parameters and the store’s capacities (phase-446 F3’s param_service_bound). It is static and not heap for the reason phase-391 keeps every payload buffer static: the Zephyr heap gate prices arena + 24576 and a new term in it is a new way for an image to stop linking.

Sync because the ring over it is SPSC. The producer is the transport’s read task, the consumer is the executor’s spin, they are never on the same slot, and the ordering is carried by the cursors in the backend’s per-queryable header – the contract a backend-owned inline array already relied on, now stated on the type that leaves the backend.

Implementations§

Source§

impl<const S: usize, const D: usize> CallerInboxStorage<S, D>

Source

pub const BYTES: usize

What one queryable’s ring costs at this geometry: the slots plus their entries. The per-queryable header is NOT in it – that is paid once per queryable whatever the ring is, and it stays the backend’s.

Source

pub const fn new() -> Self

An empty ring.

Source

pub const fn slot_bytes(&self) -> usize

Bytes one request slot holds.

Source

pub const fn depth(&self) -> usize

Slots in the ring.

Trait Implementations§

Source§

impl<const S: usize, const D: usize> Default for CallerInboxStorage<S, D>

Source§

fn default() -> Self

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

impl<const S: usize, const D: usize> Sync for CallerInboxStorage<S, D>

Auto Trait Implementations§

§

impl<const SLOT_BYTES: usize, const DEPTH: usize> !Freeze for CallerInboxStorage<SLOT_BYTES, DEPTH>

§

impl<const SLOT_BYTES: usize, const DEPTH: usize> !RefUnwindSafe for CallerInboxStorage<SLOT_BYTES, DEPTH>

§

impl<const SLOT_BYTES: usize, const DEPTH: usize> Send for CallerInboxStorage<SLOT_BYTES, DEPTH>

§

impl<const SLOT_BYTES: usize, const DEPTH: usize> Unpin for CallerInboxStorage<SLOT_BYTES, DEPTH>

§

impl<const SLOT_BYTES: usize, const DEPTH: usize> UnsafeUnpin for CallerInboxStorage<SLOT_BYTES, DEPTH>

§

impl<const SLOT_BYTES: usize, const DEPTH: usize> UnwindSafe for CallerInboxStorage<SLOT_BYTES, DEPTH>

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.