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<Value> for Set
impl FromIterator<Value> for Set
source§impl Ord for Set
impl Ord for Set
source§impl PartialOrd for Set
impl PartialOrd for Set
impl 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more