pub struct Index { /* private fields */ }Expand description
Index
Implementations§
Source§impl Index
impl Index
Sourcepub const fn new(
name: &'static str,
fields: &'static [&'static str],
unique: bool,
) -> Self
pub const fn new( name: &'static str, fields: &'static [&'static str], unique: bool, ) -> Self
Build one index declaration from field-list and uniqueness metadata.
Sourcepub const fn new_with_predicate(
name: &'static str,
fields: &'static [&'static str],
unique: bool,
predicate: Option<&'static str>,
predicate_expression: Option<SourceExpressionResolver>,
) -> Self
pub const fn new_with_predicate( name: &'static str, fields: &'static [&'static str], unique: bool, predicate: Option<&'static str>, predicate_expression: Option<SourceExpressionResolver>, ) -> Self
Build one index declaration with optional conditional predicate metadata.
Sourcepub const fn new_with_key_items(
name: &'static str,
fields: &'static [&'static str],
key_items: &'static [IndexKeyItem],
unique: bool,
) -> Self
pub const fn new_with_key_items( name: &'static str, fields: &'static [&'static str], key_items: &'static [IndexKeyItem], unique: bool, ) -> Self
Build one index declaration with explicit canonical key-item metadata.
Sourcepub const fn new_with_key_items_and_predicate(
name: &'static str,
fields: &'static [&'static str],
key_items: Option<&'static [IndexKeyItem]>,
unique: bool,
predicate: Option<&'static str>,
predicate_expression: Option<SourceExpressionResolver>,
) -> Self
pub const fn new_with_key_items_and_predicate( name: &'static str, fields: &'static [&'static str], key_items: Option<&'static [IndexKeyItem]>, unique: bool, predicate: Option<&'static str>, predicate_expression: Option<SourceExpressionResolver>, ) -> Self
Build one index declaration with explicit key items + predicate 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 conditional-index predicate SQL metadata.
This text is input-only; runtime/planner semantics must consume the canonical lowered predicate form.
Sourcepub fn source_predicate(
&self,
schema: &Schema,
) -> Result<Option<SourceCheckExpr>, SchemaContractError>
pub fn source_predicate( &self, schema: &Schema, ) -> Result<Option<SourceCheckExpr>, SchemaContractError>
Lower the optional compiler-validated predicate into the public source AST.
§Errors
Returns a typed proposal error when an enum literal no longer resolves through the sealed graph or the expression violates public bounds.