pub struct CompiledCondition {
pub entries: Vec<ParsedCondition>,
}Expand description
A statement’s fully-parsed Condition block. Multiple entries are
combined with AND: every entry must evaluate to true for the
statement to apply.
Fields§
§entries: Vec<ParsedCondition>Implementations§
Source§impl CompiledCondition
impl CompiledCondition
Sourcepub fn parse(value: &Value) -> Self
pub fn parse(value: &Value) -> Self
Parse a Condition block JSON value into a CompiledCondition.
AWS’s condition block shape is:
{ "OperatorName": { "key1": "val", "key2": ["v1", "v2"] }, ... }Operators that fail to parse (unknown base name) become
ParsedCondition entries with an Unknown marker via a
sentinel: we still record them so evaluation can safe-fail. We
model this as “if any entry has an unrecognized operator, the
whole condition block evaluates to false” — recorded via a
dedicated unknown_operators vec.
Sourcepub fn matches(&self, ctx: &ConditionContext) -> bool
pub fn matches(&self, ctx: &ConditionContext) -> bool
Evaluate this condition block against a ConditionContext.
Returns true iff every entry matches (AND semantics).
Trait Implementations§
Source§impl Clone for CompiledCondition
impl Clone for CompiledCondition
Source§fn clone(&self) -> CompiledCondition
fn clone(&self) -> CompiledCondition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 CompiledCondition
impl Debug for CompiledCondition
Source§impl Default for CompiledCondition
impl Default for CompiledCondition
Source§fn default() -> CompiledCondition
fn default() -> CompiledCondition
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CompiledCondition
impl RefUnwindSafe for CompiledCondition
impl Send for CompiledCondition
impl Sync for CompiledCondition
impl Unpin for CompiledCondition
impl UnsafeUnpin for CompiledCondition
impl UnwindSafe for CompiledCondition
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