pub struct PaymentGate { /* private fields */ }Expand description
Per-route payment gate factory.
Holds a shared reference to the X402ResourceServer and provides
PaymentGate::route to create per-route PaymentRouteLayer instances.
Implementations§
Source§impl PaymentGate
impl PaymentGate
Sourcepub fn new(server: Arc<X402ResourceServer>) -> Self
pub fn new(server: Arc<X402ResourceServer>) -> Self
Creates a new payment gate backed by the given resource server.
Sourcepub fn route(&self, config: RouteConfig) -> PaymentRouteLayer
pub fn route(&self, config: RouteConfig) -> PaymentRouteLayer
Creates a per-route layer for the given route configuration.
The returned PaymentRouteLayer implements Layer and can be
applied to individual Axum routes via .layer().
Trait Implementations§
Source§impl Clone for PaymentGate
impl Clone for PaymentGate
Source§fn clone(&self) -> PaymentGate
fn clone(&self) -> PaymentGate
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for PaymentGate
impl !RefUnwindSafe for PaymentGate
impl Send for PaymentGate
impl Sync for PaymentGate
impl Unpin for PaymentGate
impl !UnwindSafe for PaymentGate
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