pub enum Predicate {
Show 16 variants
Eq {
property: String,
value: Value,
},
Neq {
property: String,
value: Value,
},
Gt {
property: String,
value: Value,
},
Gte {
property: String,
value: Value,
},
Lt {
property: String,
value: Value,
},
Lte {
property: String,
value: Value,
},
Exists(String),
OneOf {
property: String,
values: Vec<Value>,
},
MatchesGlob {
property: String,
pattern: String,
},
StartsWith {
property: String,
prefix: String,
},
Contains {
property: String,
substring: String,
},
And(Box<Predicate>, Box<Predicate>),
Or(Box<Predicate>, Box<Predicate>),
Not(Box<Predicate>),
Always,
Never,
}Expand description
High-level retry predicate that keeps tree structure until conversion.
Variants§
Eq
Neq
Gt
Gte
Lt
Lte
Exists(String)
OneOf
MatchesGlob
StartsWith
Contains
And(Box<Predicate>, Box<Predicate>)
Or(Box<Predicate>, Box<Predicate>)
Not(Box<Predicate>)
Always
Never
Implementations§
Source§impl Predicate
impl Predicate
pub fn always() -> Self
pub fn never() -> Self
pub fn eq(property: impl Into<String>, value: impl Into<Value>) -> Self
pub fn neq(property: impl Into<String>, value: impl Into<Value>) -> Self
pub fn gt(property: impl Into<String>, value: impl Into<Value>) -> Self
pub fn gte(property: impl Into<String>, value: impl Into<Value>) -> Self
pub fn lt(property: impl Into<String>, value: impl Into<Value>) -> Self
pub fn lte(property: impl Into<String>, value: impl Into<Value>) -> Self
pub fn exists(property: impl Into<String>) -> Self
pub fn one_of<I, V>(property: impl Into<String>, values: I) -> Self
pub fn matches_glob( property: impl Into<String>, pattern: impl Into<String>, ) -> Self
pub fn starts_with( property: impl Into<String>, prefix: impl Into<String>, ) -> Self
pub fn contains( property: impl Into<String>, substring: impl Into<String>, ) -> Self
pub fn and(left: Predicate, right: Predicate) -> Self
pub fn or(left: Predicate, right: Predicate) -> Self
pub fn not(inner: Predicate) -> Self
pub fn try_to_raw(&self) -> Result<RetryPredicate, RetryBuilderError>
Trait Implementations§
Source§impl TryFrom<Predicate> for RetryPredicate
impl TryFrom<Predicate> for RetryPredicate
impl StructuralPartialEq for Predicate
Auto Trait Implementations§
impl Freeze for Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnsafeUnpin for Predicate
impl UnwindSafe for Predicate
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