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:
- Authentication has been completed (Dialog
) - Account has valid IBAN + BIC (Account)
Required Methods§
fn config(&self) -> &BankConfig
Sourcefn 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 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.
Sourcefn fetch(
&self,
dialog: &mut Dialog<Open>,
account: &Account,
days: u32,
) -> impl Future<Output = Result<FetchResult>> + Send
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.
Sourcefn fetch_holdings(
&self,
dialog: &mut Dialog<Open>,
account: &Account,
) -> impl Future<Output = Result<Vec<SecurityHolding>>> + Send
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.