Skip to main content

DynSchemeNetworkServer

Trait DynSchemeNetworkServer 

Source
pub trait DynSchemeNetworkServer: Send + Sync {
    // Required methods
    fn scheme(&self) -> &str;
    fn default_asset_transfer_method(&self) -> &str;
    fn payment_flows(&self) -> &HashMap<String, PaymentFlowConfig>;
    fn dynamic_extra_fields(&self) -> &[&str];
    fn enrich_payment_required_response<'a>(
        &'a self,
        ctx: &'a SchemePaymentRequiredContext<'a>,
    ) -> BoxFuture<'a, Option<Vec<PaymentRequirements>>>;
    fn enrich_settlement_payload<'a>(
        &'a self,
        ctx: &'a SettleContext,
    ) -> BoxFuture<'a, Result<Option<Map<String, Value>>, FacilitatorError>>;
    fn enrich_settlement_response<'a>(
        &'a self,
        ctx: &'a SettleResultContext,
    ) -> BoxFuture<'a, Option<Map<String, Value>>>;
    fn settle_on_cancel<'a>(
        &'a self,
        ctx: &'a VerifiedPaymentCanceledContext,
    ) -> BoxFuture<'a, Option<PaymentRequirements>>;
    fn settles_on_cancel(&self) -> bool;
    fn validate_facilitator_support(
        &self,
        network: &ChainId,
        kind: &SupportedPaymentKind,
        facilitator_extensions: &[CompactString],
    ) -> Result<(), FacilitatorSupportError>;
}
Expand description

Object-safe erasure of SchemeNetworkServer.

Required Methods§

Source

fn scheme(&self) -> &str

Source

fn default_asset_transfer_method(&self) -> &str

Source

fn payment_flows(&self) -> &HashMap<String, PaymentFlowConfig>

Source

fn dynamic_extra_fields(&self) -> &[&str]

Source

fn enrich_payment_required_response<'a>( &'a self, ctx: &'a SchemePaymentRequiredContext<'a>, ) -> BoxFuture<'a, Option<Vec<PaymentRequirements>>>

Source

fn enrich_settlement_payload<'a>( &'a self, ctx: &'a SettleContext, ) -> BoxFuture<'a, Result<Option<Map<String, Value>>, FacilitatorError>>

Source

fn enrich_settlement_response<'a>( &'a self, ctx: &'a SettleResultContext, ) -> BoxFuture<'a, Option<Map<String, Value>>>

Source

fn settle_on_cancel<'a>( &'a self, ctx: &'a VerifiedPaymentCanceledContext, ) -> BoxFuture<'a, Option<PaymentRequirements>>

Source

fn settles_on_cancel(&self) -> bool

Source

fn validate_facilitator_support( &self, network: &ChainId, kind: &SupportedPaymentKind, facilitator_extensions: &[CompactString], ) -> Result<(), FacilitatorSupportError>

See SchemeNetworkServer::validate_facilitator_support.

§Errors

FacilitatorSupportError when the advertised kind cannot serve this scheme.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§