Skip to main content

Module indexing

Module indexing 

Source
Expand description

Polymorphic indexing traits for Logos collections.

Logos uses 1-based indexing to match natural language conventions. These traits provide get/set operations that automatically convert 1-based indices to 0-based for underlying Rust collections.

§Supported Collections

  • Vec<T>: Indexed by i64 (1-based, converted to 0-based internally)
  • [HashMap<K, V>]: Indexed by key K (pass-through semantics)
  • [HashMap<String, V>]: Also supports &str keys for convenience

§Panics

Vector indexing operations panic if the index is out of bounds (less than 1 or greater than collection length). Map operations panic if the key is not found.

Traits§

LogosGetChar
Zero-allocation character access for string comparisons.
LogosIndex
Immutable element access by index.
LogosIndexMut
Mutable element access by index.