logos.lang.writ.array

Module lang · package logos-lang

Traits

traitWArrTag

trait WArrTag

Marks a primitive as a typed-array element; arr_code() returns its Writ wire tag. Implemented for u8..u64, i8..i64, f32, f64 (codes 2101–2110); WAny does not satisfy it, which keeps the typed and heterogeneous method sets from colliding.

Implemented by: u8 u16 u32 u64 i8 i16 i32 i64 f32 f64

Types

structWArray

struct WArray

Typed homogeneous packed array of a primitive T: WArrTag, in-arena and never moved. Generic base of the pair; the WArray<WAny> specialisation is the heterogeneous array.

Fields

cap: i64

Allocated element capacity.

data: *mut T

Element buffer: packed plain Ts behind a self-relative pointer.

len: i64

Number of elements.

Methods

fn get(self: &WArray<WAny>, i: i64) -> WAny

Returns element i by value. No bounds check — i must be less than len().

fn get_mut(self: &mut WArray<WAny>, i: i64) -> WAnyMut

Returns a mutable cursor onto element i: the element slot plus this array’s zone, so a nested child can grow in the same arena and a Pod reads/replaces in place. No bounds check.

fn push(self: &mut WArray<WAny>, v: &[u8]) -> void

Appends a str by interning its bytes into this array’s zone as a WString, pushing a Ref. The interned copy lives as long as the container.