pub struct X402PaymentAdapter { /* private fields */ }Expand description
Thin prepaid HTTP payment bridge for x402-style per-request settlement.
The adapter intentionally stays narrow: it only performs one remote authorization request and treats later capture/release/refund actions as prepaid bookkeeping. This keeps the bridge small while still giving the kernel a real external authorization hop before execution.
Implementations§
Trait Implementations§
Source§impl Clone for X402PaymentAdapter
impl Clone for X402PaymentAdapter
Source§fn clone(&self) -> X402PaymentAdapter
fn clone(&self) -> X402PaymentAdapter
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 X402PaymentAdapter
impl Debug for X402PaymentAdapter
Source§impl PaymentAdapter for X402PaymentAdapter
impl PaymentAdapter for X402PaymentAdapter
fn rail_id(&self) -> &'static str
fn rail_mode(&self) -> Option<PaymentRailMode>
Authorize or prepay up to
amount_units before the tool executes. Read moreSource§fn capture(
&self,
authorization_id: &str,
_amount_units: u64,
_currency: &str,
reference: &str,
) -> Result<PaymentResult, PaymentError>
fn capture( &self, authorization_id: &str, _amount_units: u64, _currency: &str, reference: &str, ) -> Result<PaymentResult, PaymentError>
Finalize payment for the actual cost after tool execution. Read more
Source§fn release(
&self,
authorization_id: &str,
reference: &str,
) -> Result<PaymentResult, PaymentError>
fn release( &self, authorization_id: &str, reference: &str, ) -> Result<PaymentResult, PaymentError>
Release an unused authorization hold. Read more
Source§fn refund(
&self,
transaction_id: &str,
amount_units: u64,
currency: &str,
reference: &str,
) -> Result<PaymentResult, PaymentError>
fn refund( &self, transaction_id: &str, amount_units: u64, currency: &str, reference: &str, ) -> Result<PaymentResult, PaymentError>
Refund a previously executed payment.
Source§fn settlement_state(
&self,
reference: &str,
authorization_id: Option<&str>,
) -> Result<RailSettlementState, PaymentError>
fn settlement_state( &self, reference: &str, authorization_id: Option<&str>, ) -> Result<RailSettlementState, PaymentError>
Return the side-effect-free rail state for a durable reference. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for X402PaymentAdapter
impl !UnwindSafe for X402PaymentAdapter
impl Freeze for X402PaymentAdapter
impl Send for X402PaymentAdapter
impl Sync for X402PaymentAdapter
impl Unpin for X402PaymentAdapter
impl UnsafeUnpin for X402PaymentAdapter
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more