pub enum Rule {
True,
All(Vec<Rule>),
Any(Vec<Rule>),
Not(Box<Rule>),
Eq {
attr: String,
value: Value,
},
In {
attr: String,
values: Vec<Value>,
},
Cmp {
attr: String,
op: CmpOp,
value: Value,
},
StartsWith {
attr: String,
prefix: String,
},
Cohort(String),
Window {
from: Timestamp,
until: Timestamp,
},
}Expand description
A targeting rule.
Variants§
True
Always true.
All(Vec<Rule>)
Every sub-rule is true (empty: true).
Any(Vec<Rule>)
Some sub-rule is true (empty: false).
Not(Box<Rule>)
Negation.
Eq
Attribute equals value.
In
Attribute is one of the values.
Cmp
Ordered comparison; both sides must be integers or both versions.
StartsWith
String attribute starts with a prefix (e.g. locale starts with de).
Cohort(String)
The user installed a signed cohort token with this name (e.g. beta testers).
Window
Only between two times (UTC).
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Rule
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Forget for Rule
impl Freeze for Rule
impl Move for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more