pub enum ConditionOp {
Arn(ArnCmp, Variant),
Binary(Variant),
Bool(Variant),
Date(DateCmp, Variant),
IpAddress(Variant),
Null,
Numeric(NumericCmp, Variant),
String(StringCmp, Variant),
}
Expand description
An operator for a condition clause.
Variants§
Arn(ArnCmp, Variant)
Operators for ARNs.
Binary(Variant)
Operators for binary values. Variant here is only allowed to be Variant::None or Variant::IfExists.
Bool(Variant)
Operators on boolean values. Variant here is only allowed to be Variant::None or Variant::IfExists.
Date(DateCmp, Variant)
Operators for date/time values.
IpAddress(Variant)
Operators on IP addresses and networks.
Null
Operator on the presence/absence of a value.
Numeric(NumericCmp, Variant)
Operators on numeric values.
String(StringCmp, Variant)
Operators on string vaules.
Implementations§
Source§impl ConditionOp
impl ConditionOp
Sourcepub fn matches(
&self,
condition: &BTreeMap<String, StringLikeList<String>>,
context: &Context,
pv: PolicyVersion,
) -> Result<bool, AspenError>
pub fn matches( &self, condition: &BTreeMap<String, StringLikeList<String>>, context: &Context, pv: PolicyVersion, ) -> Result<bool, AspenError>
Indicates whether this condition operator matches the request Context.
Any variables in the condition are resolved according to the specified PolicyVersion.
§Errors
If a condition clause contains a malformed variable reference and PolicyVersion::V2012_10_17 or later is used, AspenError::InvalidSubstitution is returned.
Trait Implementations§
Source§impl Borrow<str> for ConditionOp
impl Borrow<str> for ConditionOp
Source§impl Clone for ConditionOp
impl Clone for ConditionOp
Source§fn clone(&self) -> ConditionOp
fn clone(&self) -> ConditionOp
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 ConditionOp
impl Debug for ConditionOp
Source§impl<'de> Deserialize<'de> for ConditionOp
impl<'de> Deserialize<'de> for ConditionOp
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ConditionOp
impl Display for ConditionOp
Source§impl FromStr for ConditionOp
impl FromStr for ConditionOp
Source§impl Hash for ConditionOp
impl Hash for ConditionOp
Source§impl Ord for ConditionOp
impl Ord for ConditionOp
Source§fn cmp(&self, other: &ConditionOp) -> Ordering
fn cmp(&self, other: &ConditionOp) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq<str> for ConditionOp
impl PartialEq<str> for ConditionOp
Source§impl PartialEq for ConditionOp
impl PartialEq for ConditionOp
Source§impl PartialOrd for ConditionOp
impl PartialOrd for ConditionOp
Source§impl Serialize for ConditionOp
impl Serialize for ConditionOp
impl Copy for ConditionOp
impl Eq for ConditionOp
impl StructuralPartialEq for ConditionOp
Auto Trait Implementations§
impl Freeze for ConditionOp
impl RefUnwindSafe for ConditionOp
impl Send for ConditionOp
impl Sync for ConditionOp
impl Unpin for ConditionOp
impl UnwindSafe for ConditionOp
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