Skip to main content

Arena

Struct Arena 

Source
pub struct Arena<'a, E: FloatElement, const N: usize, K: SymbolCode = u16> { /* private fields */ }
Expand description

A codebook of one artifact’s distinct bit patterns.

Mechanically the arena is a one-element block grid, and its decode is the same table read. What makes it a tier rather than a Grid is the construction discipline the token carries into the kappa manifest: the table is the source stream’s distinct symbols in canonical order, built by canonicalize, so two artifacts holding the same values share a codebook — and an address — whatever order their streams stored them in (§6.4, CK-10).

The element type is a float: the symbols are bit patterns, and the bound is Whole because membership is discharged by the table’s construction and no magnitude question applies to a float (§5.2b).

The code width is a parameter, u16 by default and u8 where the artifact’s distinct patterns fit a byte (CK-14): one type at two residencies, not two tiers. At a power-of-two code space the stored code masked is the index at either width, so both spellings answer their own stream to the tabulated gather — IndexStream::U16 and IndexStream::U8 — and the traversal builds nothing.

Implementations§

Source§

impl<'a, E: FloatElement, const N: usize, K: SymbolCode> Arena<'a, E, N, K>

Source

pub const fn new(table: &'a [Alphabet<E, Whole<E>>; N]) -> Self

Borrow a canonical codebook. The canonicalization is canonicalize’s discipline; like Grid, the borrow itself validates nothing (§6.2).

Source

pub const fn table(&self) -> &'a [Alphabet<E, Whole<E>>; N]

The codebook.

Trait Implementations§

Source§

impl<'a, E: Clone + FloatElement, const N: usize, K: Clone + SymbolCode> Clone for Arena<'a, E, N, K>

Source§

fn clone(&self) -> Arena<'a, E, N, K>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<E: FloatElement, const N: usize, K: SymbolCode> Codec<E, Whole<E>> for Arena<'_, E, N, K>

Source§

const MAX_BLOCK: usize = 1

The most alphabet elements one code can produce. Read more
Source§

const TIER: TierId = TierId::Arena

Which tier this is, for reports and for the kappa manifest.
Source§

type Code = K

The stored code type. Read more
Source§

fn decode_element(&self, code: Self::Code, _i: usize) -> Alphabet<E, Whole<E>>

Decode element i of the block code names. Total for every i. Read more
Source§

const IS_FIXED_WIDTH: bool = true

Is decode_len always MAX_BLOCK? Read more
Source§

fn decode_len(&self, _code: Self::Code) -> usize

How many elements code actually produces. Read more
Source§

fn decode_into(&self, code: Self::Code, out: &mut [Alphabet<E, Bd>]) -> usize

Decode one code, returning how many elements were written. Read more
Source§

fn decode_seq(&self, codes: &[Self::Code], out: &mut [Alphabet<E, Bd>]) -> usize

Bulk path, returning how many elements were written in total.
Source§

impl<'a, E: Copy + FloatElement, const N: usize, K: Copy + SymbolCode> Copy for Arena<'a, E, N, K>

Source§

impl<'a, E: Debug + FloatElement, const N: usize, K: Debug + SymbolCode> Debug for Arena<'a, E, N, K>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<E: FloatElement, const N: usize, K: SymbolCode> Enumerable<E, Whole<E>> for Arena<'_, E, N, K>

Source§

const CODE_SPACE: usize

The number of distinct codes. Read more
Source§

fn code_at(index: usize) -> Self::Code

The index-th code. Total for index < CODE_SPACE.
Source§

fn index_of(code: Self::Code) -> usize

Where code sits in the enumeration. Read more
Source§

fn as_index_stream(codes: &[K]) -> Option<IndexStream<'_>>

The stored code stream, read as the index stream it already is. Read more
Source§

const SIGN_BIT_BOOK: bool = false

Whether the decoded book is the sign bit-decomposition: CODE_SPACE is a power of two and book[c][t] == 2 * bit(c, t) - 1 for every code c and every t below its log. Read more

Auto Trait Implementations§

§

impl<'a, E, const N: usize, K> Freeze for Arena<'a, E, N, K>

§

impl<'a, E, const N: usize, K> RefUnwindSafe for Arena<'a, E, N, K>
where E: RefUnwindSafe,

§

impl<'a, E, const N: usize, K> Send for Arena<'a, E, N, K>

§

impl<'a, E, const N: usize, K> Sync for Arena<'a, E, N, K>

§

impl<'a, E, const N: usize, K> Unpin for Arena<'a, E, N, K>

§

impl<'a, E, const N: usize, K> UnsafeUnpin for Arena<'a, E, N, K>

§

impl<'a, E, const N: usize, K> UnwindSafe for Arena<'a, E, N, K>
where E: RefUnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.