pub struct ValueAssignment<A: Eq + Hash> { /* private fields */ }Expand description
Maps each argument to the set of values it promotes.
An empty set (or absent entry) means “promotes no value” — under VAF semantics such arguments defeat unconditionally (no value preference can save a target whose attacker promotes no value, and vice versa).
Multi-value support per Kaci & van der Torre (2008): an argument may promote several values simultaneously. Single-value (Bench-Capon 2003) is the degenerate case where every set has exactly one element.
Implementations§
Source§impl<A: Eq + Hash + Clone> ValueAssignment<A>
impl<A: Eq + Hash + Clone> ValueAssignment<A>
Sourcepub fn promote(&mut self, arg: A, value: Value) -> &mut Self
pub fn promote(&mut self, arg: A, value: Value) -> &mut Self
Add a value to the set of values promoted by arg.
Returns &mut self for builder chaining.
Sourcepub fn values(&self, arg: &A) -> &[Value]
pub fn values(&self, arg: &A) -> &[Value]
The set of values promoted by arg. Returns an empty slice if
arg is not present (which is semantically the “no values” case).
Sourcepub fn entries(&self) -> impl Iterator<Item = (&A, &[Value])>
pub fn entries(&self) -> impl Iterator<Item = (&A, &[Value])>
Iterator over (argument, values) entries.
Sourcepub fn distinct_values(&self) -> BTreeSet<&Value>
pub fn distinct_values(&self) -> BTreeSet<&Value>
All distinct values mentioned anywhere in the assignment.
Trait Implementations§
Source§impl<A: Clone + Eq + Hash> Clone for ValueAssignment<A>
impl<A: Clone + Eq + Hash> Clone for ValueAssignment<A>
Source§fn clone(&self) -> ValueAssignment<A>
fn clone(&self) -> ValueAssignment<A>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more