Enum scylla_proxy::Condition
source · pub enum Condition {
True,
False,
Not(Box<Condition>),
And(Box<Condition>, Box<Condition>),
Or(Box<Condition>, Box<Condition>),
ConnectionSeqNo(usize),
RequestOpcode(RequestOpcode),
ResponseOpcode(ResponseOpcode),
BodyContainsCaseSensitive(Box<[u8]>),
BodyContainsCaseInsensitive(Box<[u8]>),
RandomWithProbability(f64),
TrueForLimitedTimes(usize),
}
Expand description
Specifies when an associated Reaction will be performed.
Conditions are subject to logic, with not()
, and()
and or()
convenience functions.
Variants§
True
False
Not(Box<Condition>)
And(Box<Condition>, Box<Condition>)
Or(Box<Condition>, Box<Condition>)
ConnectionSeqNo(usize)
True iff the frame has come in the n-th driver connection established with the driver.
RequestOpcode(RequestOpcode)
True iff the frame has the given opcode (and is a request).
ResponseOpcode(ResponseOpcode)
True iff the frame has the given opcode (and is a response).
BodyContainsCaseSensitive(Box<[u8]>)
True iff the frame body contains the given byte slice, with case-sensitive comparison.
BodyContainsCaseInsensitive(Box<[u8]>)
True iff the frame body contains the given byte slice, with case-insensitive comparison (ASCII only).
RandomWithProbability(f64)
True with the given probability.
TrueForLimitedTimes(usize)
True for predefined number of evaluations, then always false.
Implementations§
source§impl Condition
impl Condition
sourcepub fn not(c: Self) -> Self
pub fn not(c: Self) -> Self
A convenience function for creating Condition::Not variant.
sourcepub fn and(self, c2: Self) -> Self
pub fn and(self, c2: Self) -> Self
A convenience function for creating Condition::And variant.
sourcepub fn or(self, c2: Self) -> Self
pub fn or(self, c2: Self) -> Self
A convenience function for creating Condition::Or variant.