Skip to main content

portfolio

Function portfolio 

Source
pub async fn portfolio<U: PortfolioSource + ?Sized>(
    ud: &U,
    rx: &mut Receiver<Envelope>,
    source: &str,
)
Expand description

Portfolio: the snapshot works, and a portfolio update arrives after subscribe.

Calls portfolio(), then subscribe_portfolio with [brokapi_core::SubscribeOpts::lossless] (64), then waits (up to EVENT_TIMEOUT) for the first Portfolio, Positions or Balances event on rx. That envelope must have source as its source and the id returned by the subscribe as its sub.

The mock must serve a portfolio and push at least one update after subscribe. The subscription is left open.

§Panics

With [conformance:portfolio] <reason> when a call fails, no update arrives, or source or sub is wrong.

§Examples

brokapi_conformance::portfolio(&ud, &mut rx, "bcs-ud").await;