logos.lang.writ.wmap
Module lang · package logos-lang
Traits
traitWIntKeyTag
trait WIntKeyTag
Supplies the per-key Writ wire tag (MapI32AnyVal=3101 .. MapU64AnyVal=3104).
Implemented by: i32 u32 i64 u64
traitWritField
trait WritField
Converts schema field values between WAny and Self (the seam behind schema field sugar).
Implementing it makes a type schema-storable; generic schemas resolve it at monomorphization.
Implemented by: bool i64 str WAny i8 u8 i16 u16 i24 u24 i56 i32 isize u32 u56 u64 usize f32 f64 WRef
Types
structWMap
struct WMap
Anchors the WMap<K, V> family as an empty base; never instantiated directly.
Per-key-shape partial specialisations attach layout and impls (mirrors legacy Map<K,V>).
Methods
fn cap(self: &WMap<Wu6, WAny>) -> i64
Returns the fixed slot capacity (max 52).
fn contains(self: &WMap<Wu6, WAny>, key: u8) -> bool
Returns true if key is present.
fn get(self: &WMap<Wu6, WAny>, key: u8) -> WAny
Returns the value at key, or a null WAny if absent or key >= 52.
fn get_mut(self: &mut WMap<WString, WAny>, key: &[u8]) -> WAnyMut
Returns a mutable cursor onto the value at key, carrying this map’s zone.
The cursor’s slot is null when key is absent — callers must ensure the key exists.
fn key_at(self: &WMap<WString, WAny>, i: i64) -> WAny
Returns the key at slot i (interned WString Ref); null WAny if the slot is empty.
fn len(self: &WMap<WString, WAny>) -> i64
Returns the number of entries.
fn schema_type_code(self: &WMap<Wu6, WAny>) -> u64
Returns the node-class discriminator (0 = none); byte-shared with the C++ TinyObjectMap.
fn set(self: &mut WMap<Wu6, WAny>, key: u8, val: WAny) -> void
Inserts or updates key → val; key >= 52 is a silent no-op.
Panics when a NEW key would exceed the fixed capacity (over-capacity insert = bounds error).
fn set_schema_type_code(self: &mut WMap<Wu6, WAny>, code: u64) -> void
Sets the node-class discriminator.
fn size(self: &WMap<Wu6, WAny>) -> i64
Returns the number of present entries.
fn slots(self: &WMap<WString, WAny>) -> i64
Returns the slot count (cap) for raw slot iteration over 0..slots().
fn val_at(self: &WMap<WString, WAny>, i: i64) -> WAny
Returns the value at slot i; null WAny if the slot is empty.
structWMapEntry
struct WMapEntry
Stores one open-addressing slot: two at-rest WAny words (key @0, val @8).
Fields
key: i64
At-rest Ref to the interned WString key; 0 marks an empty slot.
val: i64
The stored value as an at-rest WAny word.
structWSchemaH
struct WSchemaH
Carries the runtime shape of a schema view: TOM pointer + arena allocator (ADR 0011).
The compiler’s view type S has this exact layout; make::<S>() retypes WSchemaH to S.
Fields
m: *const WMap<Wu6, WAny>
The underlying TOM (WMap<Wu6, WAny>) header.
z: *mut u8
Arena allocator for boxing wide values on write.
structWu6
struct Wu6
Labels the 6-bit key (keys 0..51) at the type level.
The bitmap-indexed map is WMap<Wu6, WAny>, aliased WTinyValMap.