pub struct SingleMappingRequestBuilder { /* private fields */ }Expand description
Builder for constructing single mapping requests to the /mapping endpoint.
Provides a fluent API for configuring mapping request parameters and executing requests.
Created via OpenFIGIClient::mapping with required ID type and value parameters.
§Examples
use openfigi_rs::client::OpenFIGIClient;
use openfigi_rs::model::enums::{IdType, Currency};
use serde_json::json;
let client = OpenFIGIClient::new();
let response = client
.mapping(IdType::ID_ISIN, json!("US4592001014"))
.currency(Currency::USD)
.send()
.await?;Implementations§
Source§impl SingleMappingRequestBuilder
impl SingleMappingRequestBuilder
Sourcepub fn id_type(self, id_type: IdType) -> Self
pub fn id_type(self, id_type: IdType) -> Self
Sets the required ID type for the mapping request.
Sourcepub fn id_value<T: Into<Value>>(self, id_value: T) -> Self
pub fn id_value<T: Into<Value>>(self, id_value: T) -> Self
Sets the required ID value for the mapping request.
Sourcepub fn filters_mut(&mut self) -> &mut RequestFilters
pub fn filters_mut(&mut self) -> &mut RequestFilters
Mutable access to the request filters, delegating to the inner MappingRequestBuilder.
Sourcepub fn exch_code(self, exch_code: ExchCode) -> Self
pub fn exch_code(self, exch_code: ExchCode) -> Self
Sets the exch_code for the desired instrument.
Sourcepub fn currency(self, currency: Currency) -> Self
pub fn currency(self, currency: Currency) -> Self
Sets the currency for the desired instrument.
Sourcepub fn market_sec_des(self, market_sec_des: MarketSecDesc) -> Self
pub fn market_sec_des(self, market_sec_des: MarketSecDesc) -> Self
Sets the market_sec_des for the desired instrument.
Sourcepub fn security_type(self, security_type: SecurityType) -> Self
pub fn security_type(self, security_type: SecurityType) -> Self
Sets the security_type for the desired instrument.
Sourcepub fn security_type2(self, security_type2: SecurityType2) -> Self
pub fn security_type2(self, security_type2: SecurityType2) -> Self
Sets the security_type2 for the desired instrument.
Sourcepub fn include_unlisted_equities(self, val: bool) -> Self
pub fn include_unlisted_equities(self, val: bool) -> Self
Sets whether to include unlisted equities in the filter.
Sourcepub fn option_type(self, option_type: OptionType) -> Self
pub fn option_type(self, option_type: OptionType) -> Self
Sets the option_type for the desired instrument.
Sourcepub fn strike(self, strike: [Option<f64>; 2]) -> Self
pub fn strike(self, strike: [Option<f64>; 2]) -> Self
Sets the strike price range for the desired instrument.
Sourcepub fn contract_size(self, contract_size: [Option<f64>; 2]) -> Self
pub fn contract_size(self, contract_size: [Option<f64>; 2]) -> Self
Sets the contract_size range for the desired instrument.
Sourcepub fn coupon(self, coupon: [Option<f64>; 2]) -> Self
pub fn coupon(self, coupon: [Option<f64>; 2]) -> Self
Sets the coupon range for the desired instrument.
Sourcepub fn expiration(self, expiration: [Option<NaiveDate>; 2]) -> Self
pub fn expiration(self, expiration: [Option<NaiveDate>; 2]) -> Self
Sets the expiration date range for the desired instrument.
Sourcepub fn maturity(self, maturity: [Option<NaiveDate>; 2]) -> Self
pub fn maturity(self, maturity: [Option<NaiveDate>; 2]) -> Self
Sets the maturity date range for the desired instrument.
Sourcepub fn state_code(self, state_code: StateCode) -> Self
pub fn state_code(self, state_code: StateCode) -> Self
Sets the state_code for the desired instrument.
Sourcepub async fn send_raw(self) -> Result<Response>
pub async fn send_raw(self) -> Result<Response>
Sends the mapping request to /mapping endpoint and returns the raw HTTP response.
This is useful when you need access to headers, status codes, or want to handle the response parsing yourself.
§Errors
Returns an crate::error::OpenFIGIError if the mapping request is invalid or if the HTTP request fails.
Sourcepub async fn send(self) -> Result<MappingData>
pub async fn send(self) -> Result<MappingData>
Sends the mapping request to /mapping endpoint and returns parsed results.
§Errors
Returns an crate::error::OpenFIGIError if the mapping request is invalid, if the HTTP request fails,
or if the response cannot be parsed.