pub struct CedarEvaluator {
pub(crate) shapes: Arc<Shapes>,
pub(crate) documents: RwLock<Vec<Arc<Document>>>,
}Expand description
The engine: one set of shapes, and every document compiled against it.
Fields§
§shapes: Arc<Shapes>§documents: RwLock<Vec<Arc<Document>>>Implementations§
Trait Implementations§
Source§impl Evaluator for CedarEvaluator
impl Evaluator for CedarEvaluator
Source§fn evaluate(
&self,
subject: &Subject<'_>,
compiled: CompiledId,
) -> Result<Outcome, EvalError>
fn evaluate( &self, subject: &Subject<'_>, compiled: CompiledId, ) -> Result<Outcome, EvalError>
Statements asked about the same subject on one thread share the request built for it, whichever evaluator holds them.
Source§fn compile(&self, predicate: &Value) -> CompileOutcome
fn compile(&self, predicate: &Value) -> CompileOutcome
Compile a predicate document into a live artifact this evaluator can
judge, or say why it cannot. Read more
Source§fn observe(&self, _event: &Observed<'_>)
fn observe(&self, _event: &Observed<'_>)
Every attempt and outcome on the declared observation surface,
whether or not evaluation short-circuited. The decision channel
short-circuits; this one does not.
Source§fn lifecycle(&self, _event: &Lifecycle<'_>)
fn lifecycle(&self, _event: &Lifecycle<'_>)
froze / unfroze / deleted, so per-account state does not outlive its
account.
Source§fn staleness(&self) -> Staleness
fn staleness(&self) -> Staleness
How stale this evaluator’s view may be before it counts as unhealthy.
Source§fn policy_lifecycle(&self, event: PolicyLifecycle)
fn policy_lifecycle(&self, event: PolicyLifecycle)
loaded / superseded / removed, so per-policy state does not outlive
the artifact it belongs to — see
PolicyLifecycle’s doc comment.
Defaulted to a no-op: an evaluator that holds no state per compiled
artifact (this crate’s regex evaluator, most builtins) has nothing
to clean up, and should not be forced to write an empty override
just to say so.Auto Trait Implementations§
impl !Freeze for CedarEvaluator
impl RefUnwindSafe for CedarEvaluator
impl Send for CedarEvaluator
impl Sync for CedarEvaluator
impl Unpin for CedarEvaluator
impl UnsafeUnpin for CedarEvaluator
impl UnwindSafe for CedarEvaluator
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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