pub enum Condition {
Eq {
attribute: String,
value: Value,
},
Ne {
attribute: String,
value: Value,
},
In {
attribute: String,
values: Vec<Value>,
},
Regex {
attribute: String,
pattern: String,
},
Gt {
attribute: String,
value: f64,
},
Lt {
attribute: String,
value: f64,
},
StartsWith {
attribute: String,
prefix: String,
},
EndsWith {
attribute: String,
suffix: String,
},
Time {
attribute: String,
start: String,
end: String,
},
And {
conditions: Vec<Condition>,
},
Or {
conditions: Vec<Condition>,
},
Not {
condition: Box<Condition>,
},
}Expand description
Policy condition.
Variants§
Eq
Check if an attribute equals a value.
Ne
Check if an attribute not equals a value.
In
Check if an attribute is in a list.
Regex
Check if an attribute matches a regex.
Gt
Check if a numeric attribute is greater than.
Lt
Check if a numeric attribute is less than.
StartsWith
Check if a string attribute starts with.
EndsWith
Check if a string attribute ends with.
Time
Check time-based conditions.
And
Boolean AND of conditions.
Or
Boolean OR of conditions.
Not
Boolean NOT of condition.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Condition
impl<'de> Deserialize<'de> for Condition
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
Auto Trait Implementations§
impl Freeze for Condition
impl RefUnwindSafe for Condition
impl Send for Condition
impl Sync for Condition
impl Unpin for Condition
impl UnsafeUnpin for Condition
impl UnwindSafe for Condition
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