pub struct ApprovalGuard { /* private fields */ }Expand description
The built-in HITL guard. Runs before the generic guard pipeline and decides whether a call passes straight through, requires approval, or was already approved by an accompanying token.
Implementations§
Source§impl ApprovalGuard
impl ApprovalGuard
pub fn new(store: Arc<dyn ApprovalStore>) -> Self
pub fn with_channel(self, channel: Arc<dyn ApprovalChannel>) -> Self
pub fn with_default_ttl(self, secs: u64) -> Self
Sourcepub fn evaluate(
&self,
ctx: ApprovalContext<'_>,
now: u64,
) -> Result<HitlVerdict, KernelError>
pub fn evaluate( &self, ctx: ApprovalContext<'_>, now: u64, ) -> Result<HitlVerdict, KernelError>
Evaluate the grant’s constraints against the request. Returns
a HitlVerdict describing the next step.
Sourcepub fn store(&self) -> Arc<dyn ApprovalStore>
pub fn store(&self) -> Arc<dyn ApprovalStore>
Accessor used by the resume flow in the HTTP layer.
Auto Trait Implementations§
impl Freeze for ApprovalGuard
impl !RefUnwindSafe for ApprovalGuard
impl Send for ApprovalGuard
impl Sync for ApprovalGuard
impl Unpin for ApprovalGuard
impl UnsafeUnpin for ApprovalGuard
impl !UnwindSafe for ApprovalGuard
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