pub struct Transaction {
pub operation: ValueOrGlob<TransactionOperation>,
}Expand description
Selector for transaction control operations (BEGIN, COMMIT,
ROLLBACK).
§String syntax examples
Transaction– any transaction operation.Transaction(BEGIN)– onlyBEGINstatements.
Fields§
§operation: ValueOrGlob<TransactionOperation>The transaction operation name, or * for any.
Implementations§
Source§impl Transaction
impl Transaction
Sourcepub fn new(operation: impl Into<ValueOrGlob<TransactionOperation>>) -> Self
pub fn new(operation: impl Into<ValueOrGlob<TransactionOperation>>) -> Self
Creates a new Transaction 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 Transaction where every field is a Glob, matching all possible values.
Sourcepub fn with_operation(
self,
value: impl Into<ValueOrGlob<TransactionOperation>>,
) -> Self
pub fn with_operation( self, value: impl Into<ValueOrGlob<TransactionOperation>>, ) -> Self
Sets Transaction::operation and returns self for method chaining.
The transaction operation name, 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 Transaction 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 Transaction 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 Transaction 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 Transaction is a Value.
Sourcepub const fn specificity(&self) -> usize
pub const fn specificity(&self) -> usize
Returns the number of Value fields on this Transaction, 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 Transaction
impl Clone for Transaction
Source§fn clone(&self) -> Transaction
fn clone(&self) -> Transaction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Transaction
impl Debug for Transaction
Source§impl Default for Transaction
Defaults to Transaction::empty, producing a selector where every field is a glob.
impl Default for Transaction
Defaults to Transaction::empty, producing a selector where every field is a glob.
Source§impl Display for Transaction
Formats this Transaction using the CLI selector syntax. When all fields are globs, renders the bare identifier Transaction; otherwise renders the identifier with parenthesized dot-separated fields.
impl Display for Transaction
Formats this Transaction using the CLI selector syntax. When all fields are globs, renders the bare identifier Transaction; otherwise renders the identifier with parenthesized dot-separated fields.
Source§impl From<Transaction> for AccessControlSelector
Converts a Transaction into its corresponding AccessControlSelector variant.
impl From<Transaction> for AccessControlSelector
Converts a Transaction into its corresponding AccessControlSelector variant.
Source§fn from(value: Transaction) -> Self
fn from(value: Transaction) -> Self
Source§impl From<Transaction> for String
Converts a Transaction into its string representation via Display.
impl From<Transaction> for String
Converts a Transaction into its string representation via Display.
Source§fn from(value: Transaction) -> Self
fn from(value: Transaction) -> Self
Source§impl FromStr for Transaction
Parses a selector string into a Transaction. Accepts the syntax Transaction or Transaction(field1.field2).
impl FromStr for Transaction
Parses a selector string into a Transaction. Accepts the syntax Transaction or Transaction(field1.field2).
Source§impl Hash for Transaction
impl Hash for Transaction
Source§impl Ord for Transaction
impl Ord for Transaction
Source§fn cmp(&self, other: &Transaction) -> Ordering
fn cmp(&self, other: &Transaction) -> 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 Transaction
impl PartialEq for Transaction
Source§impl PartialOrd for Transaction
impl PartialOrd for Transaction
Source§impl TryFrom<String> for Transaction
Parses an owned String into a Transaction by delegating to FromStr.
impl TryFrom<String> for Transaction
Parses an owned String into a Transaction by delegating to FromStr.