pub struct IndexModel { /* private fields */ }Expand description
IndexModel
Runtime-only descriptor for an index used by the executor and stores.
Keeps core decoupled from the schema Index shape.
Indexing is hash-based over Value equality for all variants.
Unique indexes enforce value equality; hash collisions surface as corruption.
Implementations§
Source§impl IndexModel
impl IndexModel
pub const fn new( name: &'static str, store: &'static str, fields: &'static [&'static str], unique: bool, ) -> Self
Sourcepub const fn new_with_ordinal(
ordinal: u16,
name: &'static str,
store: &'static str,
fields: &'static [&'static str],
unique: bool,
) -> Self
pub const fn new_with_ordinal( ordinal: u16, name: &'static str, store: &'static str, fields: &'static [&'static str], unique: bool, ) -> Self
Construct one index descriptor with one explicit stable ordinal.
Sourcepub const fn new_with_predicate(
name: &'static str,
store: &'static str,
fields: &'static [&'static str],
unique: bool,
predicate: Option<&'static str>,
) -> Self
pub const fn new_with_predicate( name: &'static str, store: &'static str, fields: &'static [&'static str], unique: bool, predicate: Option<&'static str>, ) -> Self
Construct one index descriptor with an optional conditional predicate.
Sourcepub const fn new_with_ordinal_and_predicate(
ordinal: u16,
name: &'static str,
store: &'static str,
fields: &'static [&'static str],
unique: bool,
predicate: Option<&'static str>,
) -> Self
pub const fn new_with_ordinal_and_predicate( ordinal: u16, name: &'static str, store: &'static str, fields: &'static [&'static str], unique: bool, predicate: Option<&'static str>, ) -> Self
Construct one index descriptor with an explicit stable ordinal and optional predicate.
Sourcepub const fn new_with_key_items(
name: &'static str,
store: &'static str,
fields: &'static [&'static str],
key_items: &'static [IndexKeyItem],
unique: bool,
) -> Self
pub const fn new_with_key_items( name: &'static str, store: &'static str, fields: &'static [&'static str], key_items: &'static [IndexKeyItem], unique: bool, ) -> Self
Construct one index descriptor with explicit canonical key-item metadata.
Sourcepub const fn new_with_ordinal_and_key_items(
ordinal: u16,
name: &'static str,
store: &'static str,
fields: &'static [&'static str],
key_items: &'static [IndexKeyItem],
unique: bool,
) -> Self
pub const fn new_with_ordinal_and_key_items( ordinal: u16, name: &'static str, store: &'static str, fields: &'static [&'static str], key_items: &'static [IndexKeyItem], unique: bool, ) -> Self
Construct one index descriptor with an explicit stable ordinal and key-item metadata.
Sourcepub const fn new_with_key_items_and_predicate(
name: &'static str,
store: &'static str,
fields: &'static [&'static str],
key_items: Option<&'static [IndexKeyItem]>,
unique: bool,
predicate: Option<&'static str>,
) -> Self
pub const fn new_with_key_items_and_predicate( name: &'static str, store: &'static str, fields: &'static [&'static str], key_items: Option<&'static [IndexKeyItem]>, unique: bool, predicate: Option<&'static str>, ) -> Self
Construct one index descriptor with explicit key-item + predicate metadata.
Sourcepub const fn new_with_ordinal_and_key_items_and_predicate(
ordinal: u16,
name: &'static str,
store: &'static str,
fields: &'static [&'static str],
key_items: Option<&'static [IndexKeyItem]>,
unique: bool,
predicate: Option<&'static str>,
) -> Self
pub const fn new_with_ordinal_and_key_items_and_predicate( ordinal: u16, name: &'static str, store: &'static str, fields: &'static [&'static str], key_items: Option<&'static [IndexKeyItem]>, unique: bool, predicate: Option<&'static str>, ) -> Self
Construct one index descriptor with full explicit runtime identity metadata.
Sourcepub const fn key_items(&self) -> IndexKeyItemsRef
pub const fn key_items(&self) -> IndexKeyItemsRef
Borrow canonical key-item metadata for this index.
Sourcepub const fn has_expression_key_items(&self) -> bool
pub const fn has_expression_key_items(&self) -> bool
Return whether this index includes expression key items.
Sourcepub const fn predicate(&self) -> Option<&'static str>
pub const fn predicate(&self) -> Option<&'static str>
Return optional schema-declared conditional index predicate text metadata.
This string is input-only and must be lowered through the canonical index-predicate boundary before semantic use.
Sourcepub fn is_prefix_of(&self, other: &Self) -> bool
pub fn is_prefix_of(&self, other: &Self) -> bool
Whether this index’s field prefix matches the start of another index.
Trait Implementations§
Source§impl Clone for IndexModel
impl Clone for IndexModel
Source§fn clone(&self) -> IndexModel
fn clone(&self) -> IndexModel
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more