Skip to main content

MappingRequestBuilder

Struct MappingRequestBuilder 

Source
pub struct MappingRequestBuilder { /* private fields */ }
Expand description

Builder for constructing MappingRequest instances.

Provides a fluent API for setting identifier information and filter parameters. All methods return self to enable method chaining.

§Required Fields

§Examples

use openfigi_rs::model::request::MappingRequestBuilder;
use openfigi_rs::model::enums::{IdType, Currency, ExchCode};

let request = MappingRequestBuilder::new()
    .id_type(IdType::ID_ISIN)
    .id_value("US4592001014")
    .currency(Currency::USD)
    .exch_code(ExchCode::US)
    .build()
    .unwrap();

Implementations§

Source§

impl MappingRequestBuilder

Source

pub fn new() -> Self

Creates a new MappingRequestBuilder with all fields unset.

§Examples
use openfigi_rs::model::request::MappingRequestBuilder;

let builder = MappingRequestBuilder::new();
Source

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

Sets the identifier type for the mapping request.

This field is required and specifies what type of third-party identifier is being mapped to a FIGI.

§Examples
use openfigi_rs::model::request::MappingRequestBuilder;
use openfigi_rs::model::enums::IdType;

let builder = MappingRequestBuilder::new().id_type(IdType::ID_ISIN);
Source

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

Sets the identifier value for the mapping request.

This field is required and contains the actual identifier value to be mapped. Can accept strings, numbers, or any value that converts to serde_json::Value.

§Examples
use openfigi_rs::model::request::MappingRequestBuilder;
use serde_json::json;

let builder = MappingRequestBuilder::new()
    .id_value("US4592001014")      // String
    .id_value(json!("AAPL"))       // JSON string
    .id_value(12345);              // Number
Source

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

Mutable access to the request filters.

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 fn build(self) -> Result<MappingRequest>

Builds and validates the MappingRequest.

Constructs the final request object and performs validation to ensure all requirements are met.

§Errors

Returns OpenFIGIError if validation fails, such as:

  • Missing required fields (id_type or id_value)
  • Missing security_type2 when required by identifier type
  • Mutually exclusive parameters set
  • Invalid parameter ranges
§Examples
use openfigi_rs::model::request::MappingRequestBuilder;
use openfigi_rs::model::enums::IdType;

let request = MappingRequestBuilder::new()
    .id_type(IdType::ID_ISIN)
    .id_value("US4592001014")
    .build()
    .unwrap();

Trait Implementations§

Source§

impl Default for MappingRequestBuilder

Source§

fn default() -> MappingRequestBuilder

Returns the “default value” for a type. Read more

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