Enum scratchstack_aspen::condop::ConditionOp
source · 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<ConditionOp> for ConditionOp
impl PartialEq<ConditionOp> for ConditionOp
source§fn eq(&self, other: &ConditionOp) -> bool
fn eq(&self, other: &ConditionOp) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialEq<str> for ConditionOp
impl PartialEq<str> for ConditionOp
source§impl PartialOrd<ConditionOp> for ConditionOp
impl PartialOrd<ConditionOp> for ConditionOp
source§fn partial_cmp(&self, other: &ConditionOp) -> Option<Ordering>
fn partial_cmp(&self, other: &ConditionOp) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more