Skip to main content

complete

Function complete 

pub fn complete(text: &str, market: &MarketContext) -> Result<String, FpmlError>
Expand description

Completes the stated cashflows of the first trade in text with its values on market, and returns the document’s text with them inserted.

Only a stream that already states a cashflows block is completed; a document whose streams state none comes back unchanged. A row or principal exchange paid by the market’s date is left as stated.

§Errors

What read refuses; FpmlError::Build where a stream states more or fewer rows or exchanges than helixio generates from it; FpmlError::Unsupported naming an element the writer would insert that the document already carries; FpmlError::Pricing where the market cannot price the trade.