Skip to main content

ParameterTable

Struct ParameterTable 

Source
pub struct ParameterTable<'s> { /* private fields */ }
Expand description

The slot table a ParameterServer borrows.

phase-382 W2’ — the server’s storage is CALLER-OWNED, and this newtype is what makes that expressible without publishing the slot type. A slot is a ParameterEntry, which stays PRIVATE (it is the store’s internal slot layout, not an API); a consumer that only needs to name the storage — nros-node, which carves it out of the executor backing in W3’ — names a ParameterTable instead.

The table’s LENGTH is the server’s capacity. MAX_PARAMETERS is the DEFAULT capacity (see ParameterStorage), not a bound the borrow re-imposes: a caller who hands over a longer or shorter table gets exactly that many slots, and every capacity question the server answers (is_full, the declare path) reads it from here.

Implementations§

Source§

impl<'s> ParameterTable<'s>

Source

pub fn capacity(&self) -> usize

Number of slots — the capacity of a server built on this table.

Source

pub fn occupied(&self) -> usize

Number of slots currently holding a parameter.

Source§

impl<'s> ParameterTable<'s>

Source

pub fn init_in( slots: &'s mut [MaybeUninit<ParameterSlot>], ) -> ParameterTable<'s>

Initialise slots to empty IN PLACE and borrow them as a table.

phase-382 W3’ — the home the executor carves for its store. Each slot is written through its own pointer, so the largest stack temporary is one slot, never the table (issue 0756’s hazard, which a carved region avoids by construction as long as nothing builds the table by value). Any length works; the length is the capacity, as for every table.

Trait Implementations§

Source§

impl Debug for ParameterTable<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'s> !UnwindSafe for ParameterTable<'s>

§

impl<'s> Freeze for ParameterTable<'s>

§

impl<'s> RefUnwindSafe for ParameterTable<'s>

§

impl<'s> Send for ParameterTable<'s>

§

impl<'s> Sync for ParameterTable<'s>

§

impl<'s> Unpin for ParameterTable<'s>

§

impl<'s> UnsafeUnpin for ParameterTable<'s>

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.