pub struct Read {
pub table_name: ValueOrGlob<String>,
pub column_name: ValueOrGlob<String>,
}Expand description
Selector for column-level read operations, scoped to a table and column.
When both fields are globs, this matches all read operations across the
entire database. Specifying a table_name narrows the scope to a single
table, and additionally specifying a column_name narrows it to one
column.
§String syntax examples
Read– all tables, all columns.Read(Students)– theStudentstable, all columns.Read(Students.name)– only thenamecolumn ofStudents.Read(*.name)– thenamecolumn across every table.
Fields§
§table_name: ValueOrGlob<String>The target table name, or * to match any table.
column_name: ValueOrGlob<String>The target column name, or * to match any column.
Implementations§
Source§impl Read
impl Read
Sourcepub fn new(
table_name: impl Into<ValueOrGlob<String>>,
column_name: impl Into<ValueOrGlob<String>>,
) -> Self
pub fn new( table_name: impl Into<ValueOrGlob<String>>, column_name: impl Into<ValueOrGlob<String>>, ) -> Self
Creates a new Read 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 with_table_name(self, value: impl Into<ValueOrGlob<String>>) -> Self
pub fn with_table_name(self, value: impl Into<ValueOrGlob<String>>) -> Self
Sets Read::table_name and returns self for method chaining.
The target table name, or * to match any table.
Sourcepub fn with_column_name(self, value: impl Into<ValueOrGlob<String>>) -> Self
pub fn with_column_name(self, value: impl Into<ValueOrGlob<String>>) -> Self
Sets Read::column_name and returns self for method chaining.
The target column name, or * to match any column.
Sourcepub const fn is_all_glob(&self) -> bool
pub const fn is_all_glob(&self) -> bool
Sourcepub const fn is_all_value(&self) -> bool
pub const fn is_all_value(&self) -> bool
Sourcepub const fn is_any_glob(&self) -> bool
pub const fn is_any_glob(&self) -> bool
Sourcepub const fn is_any_value(&self) -> bool
pub const fn is_any_value(&self) -> bool
Sourcepub const fn specificity(&self) -> usize
pub const fn specificity(&self) -> usize
Trait Implementations§
Source§impl Default for Read
Defaults to Read::empty, producing a selector where every field is a glob.
impl Default for Read
Defaults to Read::empty, producing a selector where every field is a glob.
Source§impl Display for Read
Formats this Read using the CLI selector syntax. When all fields are globs, renders the bare identifier Read; otherwise renders the identifier with parenthesized dot-separated fields.
impl Display for Read
Formats this Read using the CLI selector syntax. When all fields are globs, renders the bare identifier Read; otherwise renders the identifier with parenthesized dot-separated fields.
Source§impl From<Read> for AccessControlSelector
Converts a Read into its corresponding AccessControlSelector variant.
impl From<Read> for AccessControlSelector
Converts a Read into its corresponding AccessControlSelector variant.
Source§impl FromStr for Read
Parses a selector string into a Read. Accepts the syntax Read or Read(field1.field2).
impl FromStr for Read
Parses a selector string into a Read. Accepts the syntax Read or Read(field1.field2).