pub struct CompiledPolicy { /* private fields */ }Expand description
Represents a symbolically compiled policy. This can be fed into various
functions on CedarSymCompiler for efficient solver queries (that don’t
have to repeat symbolic compilation).
Implementations§
Source§impl CompiledPolicy
impl CompiledPolicy
Sourcepub fn compile(
policy: &Policy,
env: &RequestEnv,
schema: &Schema,
) -> Result<Self>
pub fn compile( policy: &Policy, env: &RequestEnv, schema: &Schema, ) -> Result<Self>
Compile a policy for the given RequestEnv.
This does all the validating and well-typing that you need; you need not
(and should not) call WellTypedPolicy::from_policy() prior to calling
this.
Sourcepub fn compile_with_custom_symenv(
policy: &Policy,
env: &RequestEnv,
schema: &Schema,
symenv: SymEnv,
) -> Result<Self>
pub fn compile_with_custom_symenv( policy: &Policy, env: &RequestEnv, schema: &Schema, symenv: SymEnv, ) -> Result<Self>
Compile a policy for the given RequestEnv, using a custom SymEnv
rather than the one that would naturally be derived from this
RequestEnv.
Most often, you want compile() instead.
compile_with_custom_symenv() is generally used to compile with
SymEnvs that are more concrete than the default SymEnvs, with
constraints/concretizations of the entity hierarchy or request
variables.
Caller is responsible for some currently-undocumented invariants about
the relationship between the RequestEnv and the SymEnv.
This function has no analogue in the Lean (as of this writing).
Use at your own risk.
Sourcepub fn into_compiled_policyset(self) -> CompiledPolicySet
pub fn into_compiled_policyset(self) -> CompiledPolicySet
Convert a CompiledPolicy to a CompiledPolicySet representing a
singleton policyset with just that policy.
This function is intended to be much more efficient than re-compiling
with CompiledPolicySet::compile().
Trait Implementations§
Source§impl Clone for CompiledPolicy
impl Clone for CompiledPolicy
Source§fn clone(&self) -> CompiledPolicy
fn clone(&self) -> CompiledPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CompiledPolicy
impl RefUnwindSafe for CompiledPolicy
impl Send for CompiledPolicy
impl Sync for CompiledPolicy
impl Unpin for CompiledPolicy
impl UnsafeUnpin for CompiledPolicy
impl UnwindSafe for CompiledPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> ⓘ
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> ⓘ
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