Skip to main content

ResolveProvider

Trait ResolveProvider 

Source
pub(crate) trait ResolveProvider {
    type Provider: PaymentProvider;

    // Required method
    fn resolve_for(
        &self,
        opts: DiscoverOptions,
    ) -> TransportResult<Self::Provider>;

    // Provided methods
    fn resolve(&self) -> TransportResult<Self::Provider> { ... }
    fn set_key_provisioned(&self, _provisioned: bool) { ... }
    fn is_key_provisioned(&self) -> bool { ... }
    fn clear_channels(&self) { ... }
    fn flush_pending(&self) { ... }
    fn rollback_pending(&self) { ... }
    fn commit_topup_and_track_voucher(&self) { ... }
    fn lock_pay(
        &self,
    ) -> impl Future<Output = Option<OwnedMutexGuard<()>>> + Send { ... }
}
Expand description

Trait for resolving a concrete PaymentProvider from a potentially lazy wrapper.

Required Associated Types§

Source

type Provider: PaymentProvider

Required Methods§

Source

fn resolve_for(&self, opts: DiscoverOptions) -> TransportResult<Self::Provider>

Provided Methods§

Source

fn resolve(&self) -> TransportResult<Self::Provider>

Source

fn set_key_provisioned(&self, _provisioned: bool)

Source

fn is_key_provisioned(&self) -> bool

Source

fn clear_channels(&self)

Source

fn flush_pending(&self)

Source

fn rollback_pending(&self)

Source

fn commit_topup_and_track_voucher(&self)

Source

fn lock_pay(&self) -> impl Future<Output = Option<OwnedMutexGuard<()>>> + Send

Acquire the payment serialization lock. The returned guard must be held across the entire 402 → pay → retry → response cycle to prevent concurrent channel opens and colliding expiring-nonce transactions.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§