pub struct Ap2CostEvent {
pub cart_id: String,
pub intent_id: String,
pub merchant: String,
pub cost_cents: u64,
pub currency: String,
}Expand description
A verified, authorized AP2 payment normalized to cents — a first-class cost
event that folds into the same cost_cents ledger as x402 and token
cost.
Fields§
§cart_id: StringThe authorized cart id.
intent_id: StringThe intent it was authorized under.
merchant: StringThe merchant paid.
cost_cents: u64The authorized amount, normalized to cents.
currency: StringThe settlement currency ("USD").
Implementations§
Source§impl Ap2CostEvent
impl Ap2CostEvent
Sourcepub fn apply_to(&self, usage: &mut BudgetUsage)
pub fn apply_to(&self, usage: &mut BudgetUsage)
Fold this authorized payment into a run’s BudgetUsage, alongside
token + x402 cost, by adding cost_cents to the shared ledger.
Saturating — a run can’t wrap its cost ledger. Does not touch
tool_calls (the payment rides a tool call the caller already counts).
Trait Implementations§
Source§impl Clone for Ap2CostEvent
impl Clone for Ap2CostEvent
Source§fn clone(&self) -> Ap2CostEvent
fn clone(&self) -> Ap2CostEvent
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 Ap2CostEvent
impl Debug for Ap2CostEvent
Source§impl<'de> Deserialize<'de> for Ap2CostEvent
impl<'de> Deserialize<'de> for Ap2CostEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Ap2CostEvent
Source§impl PartialEq for Ap2CostEvent
impl PartialEq for Ap2CostEvent
Source§impl Serialize for Ap2CostEvent
impl Serialize for Ap2CostEvent
impl StructuralPartialEq for Ap2CostEvent
Auto Trait Implementations§
impl Freeze for Ap2CostEvent
impl RefUnwindSafe for Ap2CostEvent
impl Send for Ap2CostEvent
impl Sync for Ap2CostEvent
impl Unpin for Ap2CostEvent
impl UnsafeUnpin for Ap2CostEvent
impl UnwindSafe for Ap2CostEvent
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.