Skip to main content

parse_contract_from_json

Function parse_contract_from_json 

Source
pub fn parse_contract_from_json(json: &Value) -> Result<Contract>
Expand description

Parse IB contract from JSON dictionary.

This function parses a JSON object (dictionary) representing an IBContract and converts it to a rust-ibapi Contract struct.

§Arguments

  • json - JSON value representing the contract dictionary

§Returns

Returns a Contract if parsing succeeds, or None if parsing fails.

§Errors

Returns an error if the JSON is not a valid object or if required fields are missing.