Skip to main content

FilterRequestBuilder

Struct FilterRequestBuilder 

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

Builder for constructing FilterRequest instances.

Provides a fluent API for setting filter parameters and building validated requests. All methods return self to enable method chaining.

§Examples

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

let request = FilterRequestBuilder::new()
    .query("technology")
    .currency(Currency::USD)
    .exch_code(ExchCode::US)
    .build()
    .unwrap();

Implementations§

Source§

impl FilterRequestBuilder

Source

pub fn new() -> Self

Creates a new FilterRequestBuilder with all fields unset.

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

let builder = FilterRequestBuilder::new();
Source

pub fn query(self, query: impl Into<String>) -> Self

Sets search keywords for the filter request.

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

let builder = FilterRequestBuilder::new().query("AAPL");
Source

pub fn start(self, start: impl Into<String>) -> Self

Sets the pagination start token.

Used for retrieving subsequent pages of results when the response contains a next field.

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

let builder = FilterRequestBuilder::new()
    .query("tech")
    .start("next_page_token");
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<FilterRequest>

Builds and validates the FilterRequest.

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

§Errors

Returns OpenFIGIError if validation fails, such as:

  • No query or filter parameters specified
  • Mutually exclusive parameters set
  • Invalid parameter ranges
§Examples
use openfigi_rs::model::request::FilterRequestBuilder;

let request = FilterRequestBuilder::new()
    .query("IBM")
    .build()
    .unwrap();

Trait Implementations§

Source§

impl Default for FilterRequestBuilder

Source§

fn default() -> FilterRequestBuilder

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