Skip to main content

SingleMappingRequestBuilder

Struct SingleMappingRequestBuilder 

Source
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

Source

pub fn id_type(self, id_type: IdType) -> Self

Sets the required ID type for the mapping request.

Source

pub fn id_value<T: Into<Value>>(self, id_value: T) -> Self

Sets the required ID value for the mapping request.

Source

pub fn filters_mut(&mut self) -> &mut RequestFilters

Mutable access to the request filters, delegating to the inner MappingRequestBuilder.

Source

pub fn exch_code(self, exch_code: ExchCode) -> Self

Sets the exch_code for the desired instrument.

Source

pub fn mic_code(self, mic_code: MicCode) -> Self

Sets the mic_code for the desired instrument.

Source

pub fn currency(self, currency: Currency) -> Self

Sets the currency for the desired instrument.

Source

pub fn market_sec_des(self, market_sec_des: MarketSecDesc) -> Self

Sets the market_sec_des for the desired instrument.

Source

pub fn security_type(self, security_type: SecurityType) -> Self

Sets the security_type for the desired instrument.

Source

pub fn security_type2(self, security_type2: SecurityType2) -> Self

Sets the security_type2 for the desired instrument.

Source

pub fn include_unlisted_equities(self, val: bool) -> Self

Sets whether to include unlisted equities in the filter.

Source

pub fn option_type(self, option_type: OptionType) -> Self

Sets the option_type for the desired instrument.

Source

pub fn strike(self, strike: [Option<f64>; 2]) -> Self

Sets the strike price range for the desired instrument.

Source

pub fn contract_size(self, contract_size: [Option<f64>; 2]) -> Self

Sets the contract_size range for the desired instrument.

Source

pub fn coupon(self, coupon: [Option<f64>; 2]) -> Self

Sets the coupon range for the desired instrument.

Source

pub fn expiration(self, expiration: [Option<NaiveDate>; 2]) -> Self

Sets the expiration date range for the desired instrument.

Source

pub fn maturity(self, maturity: [Option<NaiveDate>; 2]) -> Self

Sets the maturity date range for the desired instrument.

Source

pub fn state_code(self, state_code: StateCode) -> Self

Sets the state_code for the desired instrument.

Source

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.

Source

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more