pub struct CreateIndex {
pub table_name: ValueOrGlob<String>,
pub index_name: ValueOrGlob<String>,
}Expand description
Selector for CREATE INDEX statements, scoped to a table and index
name.
§String syntax examples
CreateIndex– any index on any table.CreateIndex(Students)– any index onStudents.CreateIndex(Students.idx_email)– one specific index.
Fields§
§table_name: ValueOrGlob<String>The table the index is created on, or * for any.
index_name: ValueOrGlob<String>The name of the index being created, or * for any.
Implementations§
Source§impl CreateIndex
impl CreateIndex
Sourcepub fn new(
table_name: impl Into<ValueOrGlob<String>>,
index_name: impl Into<ValueOrGlob<String>>,
) -> Self
pub fn new( table_name: impl Into<ValueOrGlob<String>>, index_name: impl Into<ValueOrGlob<String>>, ) -> Self
Creates a new CreateIndex with the provided field values.
Each argument accepts any type that implements Into<ValueOrGlob<T>>, so callers can pass a raw value, a ValueOrGlob, or an Option<T>.
Sourcepub fn empty() -> Self
pub fn empty() -> Self
Creates a CreateIndex where every field is a Glob, matching all possible values.
Sourcepub fn with_table_name(self, value: impl Into<ValueOrGlob<String>>) -> Self
pub fn with_table_name(self, value: impl Into<ValueOrGlob<String>>) -> Self
Sets CreateIndex::table_name and returns self for method chaining.
The table the index is created on, or * for any.
Sourcepub fn with_index_name(self, value: impl Into<ValueOrGlob<String>>) -> Self
pub fn with_index_name(self, value: impl Into<ValueOrGlob<String>>) -> Self
Sets CreateIndex::index_name and returns self for method chaining.
The name of the index being created, or * for any.
Sourcepub const fn is_all_glob(&self) -> bool
pub const fn is_all_glob(&self) -> bool
Returns true if every field on this CreateIndex is a Glob.
Sourcepub const fn is_all_value(&self) -> bool
pub const fn is_all_value(&self) -> bool
Returns true if every field on this CreateIndex is a Value.
Sourcepub const fn is_any_glob(&self) -> bool
pub const fn is_any_glob(&self) -> bool
Returns true if at least one field on this CreateIndex is a Glob.
Sourcepub const fn is_any_value(&self) -> bool
pub const fn is_any_value(&self) -> bool
Returns true if at least one field on this CreateIndex is a Value.
Sourcepub const fn specificity(&self) -> usize
pub const fn specificity(&self) -> usize
Returns the number of Value fields on this CreateIndex, used to rank competing policy rules during resolution. A higher specificity means the rule targets a narrower set of operations.
Trait Implementations§
Source§impl Clone for CreateIndex
impl Clone for CreateIndex
Source§fn clone(&self) -> CreateIndex
fn clone(&self) -> CreateIndex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CreateIndex
impl Debug for CreateIndex
Source§impl Default for CreateIndex
Defaults to CreateIndex::empty, producing a selector where every field is a glob.
impl Default for CreateIndex
Defaults to CreateIndex::empty, producing a selector where every field is a glob.
Source§impl Display for CreateIndex
Formats this CreateIndex using the CLI selector syntax. When all fields are globs, renders the bare identifier CreateIndex; otherwise renders the identifier with parenthesized dot-separated fields.
impl Display for CreateIndex
Formats this CreateIndex using the CLI selector syntax. When all fields are globs, renders the bare identifier CreateIndex; otherwise renders the identifier with parenthesized dot-separated fields.
Source§impl From<CreateIndex> for AccessControlSelector
Converts a CreateIndex into its corresponding AccessControlSelector variant.
impl From<CreateIndex> for AccessControlSelector
Converts a CreateIndex into its corresponding AccessControlSelector variant.
Source§fn from(value: CreateIndex) -> Self
fn from(value: CreateIndex) -> Self
Source§impl From<CreateIndex> for String
Converts a CreateIndex into its string representation via Display.
impl From<CreateIndex> for String
Converts a CreateIndex into its string representation via Display.
Source§fn from(value: CreateIndex) -> Self
fn from(value: CreateIndex) -> Self
Source§impl FromStr for CreateIndex
Parses a selector string into a CreateIndex. Accepts the syntax CreateIndex or CreateIndex(field1.field2).
impl FromStr for CreateIndex
Parses a selector string into a CreateIndex. Accepts the syntax CreateIndex or CreateIndex(field1.field2).
Source§impl Hash for CreateIndex
impl Hash for CreateIndex
Source§impl Ord for CreateIndex
impl Ord for CreateIndex
Source§fn cmp(&self, other: &CreateIndex) -> Ordering
fn cmp(&self, other: &CreateIndex) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for CreateIndex
impl PartialEq for CreateIndex
Source§impl PartialOrd for CreateIndex
impl PartialOrd for CreateIndex
Source§impl TryFrom<String> for CreateIndex
Parses an owned String into a CreateIndex by delegating to FromStr.
impl TryFrom<String> for CreateIndex
Parses an owned String into a CreateIndex by delegating to FromStr.