pub enum Ap2GateOutcome {
Authorize {
event: Ap2CostEvent,
budget_remaining_cents: Option<u64>,
},
Deny {
kind: Ap2DenyKind,
reason: String,
},
}Expand description
The pre-call spend-gate decision for an AP2 payment, produced by
evaluate_ap2_payment before any payment is authorized.
Variants§
Authorize
The signed mandate chain verified, the cart is in scope, and it fits the
budget ceiling — the caller may authorize the payment.
budget_remaining_cents is the headroom that would remain after it
settles (None when no cost cap is set).
Deny
The payment is refused — hard stop.
Implementations§
Source§impl Ap2GateOutcome
impl Ap2GateOutcome
Whether the payment may proceed.
Sourcepub fn deny_kind(&self) -> Option<Ap2DenyKind>
pub fn deny_kind(&self) -> Option<Ap2DenyKind>
The deny kind, or None when authorized.
Sourcepub fn alert_line(&self) -> Option<String>
pub fn alert_line(&self) -> Option<String>
The single operator alert to emit on a hard stop, or None when
authorized. Exactly one alert per denied mandate — one pre-call check.
Sourcepub fn to_policy_decision(&self) -> PolicyDecision
pub fn to_policy_decision(&self) -> PolicyDecision
Map onto the crate’s PolicyDecision so an AP2 verdict flows through
the same allow/deny pipeline as x402 and every other gate.
Trait Implementations§
Source§impl Clone for Ap2GateOutcome
impl Clone for Ap2GateOutcome
Source§fn clone(&self) -> Ap2GateOutcome
fn clone(&self) -> Ap2GateOutcome
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Ap2GateOutcome
impl Debug for Ap2GateOutcome
impl Eq for Ap2GateOutcome
Source§impl PartialEq for Ap2GateOutcome
impl PartialEq for Ap2GateOutcome
impl StructuralPartialEq for Ap2GateOutcome
Auto Trait Implementations§
impl Freeze for Ap2GateOutcome
impl RefUnwindSafe for Ap2GateOutcome
impl Send for Ap2GateOutcome
impl Sync for Ap2GateOutcome
impl Unpin for Ap2GateOutcome
impl UnsafeUnpin for Ap2GateOutcome
impl UnwindSafe for Ap2GateOutcome
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.