Struct cedar_policy_core::ast::Set
source · pub struct Set {
pub authoritative: Arc<BTreeSet<Value>>,
pub fast: Option<Arc<HashSet<Literal>>>,
}
Expand description
Value
’s internal representation of a Set
Fields§
the values in the set, stored in a BTreeSet
fast: Option<Arc<HashSet<Literal>>>
if possible, HashSet<Literal>
representation of the set.
(This is possible if all the elements are literals.)
Some operations are much faster in this case.
INVARIANT (FastRepr)
we guarantee that if the elements are all
literals, then this will be Some
. (This allows us to further
optimize e.g. equality checks between sets: for instance, we know
that if one set has fast
and another does not, the sets can’t be
equal.)
Implementations§
Trait Implementations§
source§impl FromIterator<Literal> for Set
impl FromIterator<Literal> for Set
source§impl FromIterator<Value> for Set
impl FromIterator<Value> for Set
source§impl Ord for Set
impl Ord for Set
source§impl PartialEq for Set
impl PartialEq for Set
source§impl PartialOrd for Set
impl PartialOrd for Set
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 moreimpl Eq for Set
Auto Trait Implementations§
impl Freeze for Set
impl RefUnwindSafe for Set
impl Send for Set
impl Sync for Set
impl Unpin for Set
impl UnwindSafe for Set
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