pub struct Gate { /* private fields */ }Expand description
A pure decision gate over an ordered list of checks.
Implementations§
Source§impl Gate
impl Gate
Sourcepub fn builder() -> GateBuilder
pub fn builder() -> GateBuilder
Start building a gate.
Sourcepub fn evaluate(&self, ctx: &ActionContext) -> Decision
pub fn evaluate(&self, ctx: &ActionContext) -> Decision
Evaluate ctx against the checks in order. The first check to return
Some wins; if none does, the gate allows.
Sourcepub fn config_hash(&self) -> String
pub fn config_hash(&self) -> String
A stable sha256:<hex> hash of the gate’s configuration: the ordered
list of each check’s config_fingerprint.
Record this in a ledger alongside a decision to prove the decision came from exactly this gate configuration. Because it is order-sensitive and folds in each check’s parameters, a reordered or reconfigured gate hashes differently.
Auto Trait Implementations§
impl !RefUnwindSafe for Gate
impl !UnwindSafe for Gate
impl Freeze for Gate
impl Send for Gate
impl Sync for Gate
impl Unpin for Gate
impl UnsafeUnpin for Gate
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