Struct relay_protocol::condition::EqCondition
source · pub struct EqCondition {
pub name: String,
pub value: Value,
pub options: EqCondOptions,
}
Expand description
A condition that compares values for equality.
This operator supports:
- boolean
- strings, optionally ignoring ASCII-case
- UUIDs
Fields§
§name: String
Path of the field that should match the value.
value: Value
The value to check against.
When comparing with a string field, this value can be an array. The condition matches if any of the provided values matches the field.
options: EqCondOptions
Configuration options for the condition.
Implementations§
source§impl EqCondition
impl EqCondition
sourcepub fn new(field: impl Into<String>, value: impl Into<Value>) -> Self
pub fn new(field: impl Into<String>, value: impl Into<Value>) -> Self
Creates a new condition that checks for equality.
By default, this condition will perform a case-sensitive check. To ignore ASCII case, use
EqCondition::ignore_case
.
The main way to create this conditions is RuleCondition::eq
.
sourcepub fn ignore_case(self) -> Self
pub fn ignore_case(self) -> Self
Enables case-insensitive comparisions for this rule.
To create such a condition directly, use RuleCondition::eq_ignore_case
.
Trait Implementations§
source§impl Clone for EqCondition
impl Clone for EqCondition
source§fn clone(&self) -> EqCondition
fn clone(&self) -> EqCondition
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for EqCondition
impl Debug for EqCondition
source§impl<'de> Deserialize<'de> for EqCondition
impl<'de> Deserialize<'de> for EqCondition
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
source§impl PartialEq for EqCondition
impl PartialEq for EqCondition
source§impl Serialize for EqCondition
impl Serialize for EqCondition
impl StructuralPartialEq for EqCondition
Auto Trait Implementations§
impl Freeze for EqCondition
impl RefUnwindSafe for EqCondition
impl Send for EqCondition
impl Sync for EqCondition
impl Unpin for EqCondition
impl UnwindSafe for EqCondition
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)