Skip to main content

BankOps

Trait BankOps 

Source
pub trait BankOps: Send + Sync {
    // Required methods
    fn config(&self) -> &BankConfig;
    fn initiate(
        &self,
        username: &UserId,
        pin: &Pin,
        product_id: &ProductId,
        system_id: Option<&SystemId>,
        target_iban: Option<&Iban>,
        target_bic: Option<&Bic>,
    ) -> impl Future<Output = Result<InitiateOutcome>> + Send;
    fn fetch(
        &self,
        dialog: &mut Dialog<Open>,
        account: &Account,
        days: u32,
    ) -> impl Future<Output = Result<FetchResult>> + Send;
    fn fetch_holdings(
        &self,
        dialog: &mut Dialog<Open>,
        account: &Account,
    ) -> impl Future<Output = Result<Vec<SecurityHolding>>> + Send;
}
Expand description

Each bank implements its own workflow as typed Dialog transitions.

fetch() takes &mut Dialog<Open> and &Account — compile-time proof that:

  1. Authentication has been completed (Dialog)
  2. Account has valid IBAN + BIC (Account)

Required Methods§

Source

fn config(&self) -> &BankConfig

Source

fn initiate( &self, username: &UserId, pin: &Pin, product_id: &ProductId, system_id: Option<&SystemId>, target_iban: Option<&Iban>, target_bic: Option<&Bic>, ) -> impl Future<Output = Result<InitiateOutcome>> + Send

Phase 1: sync + init, return TAN challenge or authenticated dialog.

Source

fn fetch( &self, dialog: &mut Dialog<Open>, account: &Account, days: u32, ) -> impl Future<Output = Result<FetchResult>> + Send

Phase 2: fetch balance + transactions from an open dialog. Takes &Account — IBAN and BIC are guaranteed present.

Source

fn fetch_holdings( &self, dialog: &mut Dialog<Open>, account: &Account, ) -> impl Future<Output = Result<Vec<SecurityHolding>>> + Send

Fetch securities holdings from an open dialog. Takes &Account — IBAN and BIC are guaranteed present. Returns an empty Vec if the bank does not support depot queries.

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§