pub struct ThresholdGate { /* private fields */ }Expand description
Auto-approves operations up to a given risk level; delegates higher-risk operations to an inner callback.
Implementations§
Source§impl ThresholdGate
impl ThresholdGate
Sourcepub fn new(threshold: RiskLevel, inner: impl ApprovalCallback + 'static) -> Self
pub fn new(threshold: RiskLevel, inner: impl ApprovalCallback + 'static) -> Self
Create a new threshold gate.
Trait Implementations§
Source§impl ApprovalCallback for ThresholdGate
impl ApprovalCallback for ThresholdGate
Source§fn request(&self, req: ApprovalRequest) -> BoxFuture<'_, ApprovalDecision>
fn request(&self, req: ApprovalRequest) -> BoxFuture<'_, ApprovalDecision>
Evaluate an approval request and return a decision.
Auto Trait Implementations§
impl !Freeze for ThresholdGate
impl !RefUnwindSafe for ThresholdGate
impl !UnwindSafe for ThresholdGate
impl Send for ThresholdGate
impl Sync for ThresholdGate
impl Unpin for ThresholdGate
impl UnsafeUnpin for ThresholdGate
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