cedar_policy_validator

Struct AllDefs

Source
pub struct AllDefs { /* private fields */ }
Expand description

Holds the sets of all entity type, common type, and action definitions (fully-qualified names) in all fragments.

Implementations§

Source§

impl AllDefs

Source

pub fn new<'a, N: 'a, A: 'a, I>(fragments: impl Fn() -> I) -> Self
where I: Iterator<Item = &'a ValidatorSchemaFragment<N, A>>,

Build the sets of all entity type, common type, and action definitions (fully-qualified names) in all fragments.

Source

pub fn single_fragment<N, A>(fragment: &ValidatorSchemaFragment<N, A>) -> Self

Build an AllDefs assuming that the given fragment is the only fragment that exists. Any names referring to definitions in other fragments will not resolve properly.

Source

pub fn is_defined_as_entity(&self, name: &InternalName) -> bool

Is the given (fully-qualified) InternalName defined as an entity type in any fragment?

Source

pub fn is_defined_as_common(&self, name: &InternalName) -> bool

Is the given (fully-qualified) InternalName defined as a common type in any fragment?

Source

pub fn is_defined_as_action(&self, euid: &EntityUID) -> bool

Is the given (fully-qualified) EntityUID defined as an action in any fragment?

Source

pub fn mark_as_defined_as_common_type(&mut self, name: InternalName)

Mark the given InternalName as defined as a common type

Source

pub fn rfc_70_shadowing_checks(&self) -> Result<()>

Return an error if the definitions in this AllDefs violate the restrictions specified in RFC 70.

RFC 70 disallows definitions of entity types, common types, and actions that would shadow definitions of other entity types, common types, or actions in the empty namespace.

Trait Implementations§

Source§

impl Debug for AllDefs

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.