Skip to main content

PolymarketDataClientConfigBuilder

Struct PolymarketDataClientConfigBuilder 

Source
pub struct PolymarketDataClientConfigBuilder<S: State = Empty> { /* private fields */ }
Expand description

Use builder syntax to set the inputs and finish with build().

Implementations§

Source§

impl<S: State> PolymarketDataClientConfigBuilder<S>

Source

pub fn build(self) -> PolymarketDataClientConfig
where S: IsComplete,

Finish building and return the requested object

Source

pub fn base_url_http( self, value: String, ) -> PolymarketDataClientConfigBuilder<SetBaseUrlHttp<S>>
where S::BaseUrlHttp: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_base_url_http( self, value: Option<String>, ) -> PolymarketDataClientConfigBuilder<SetBaseUrlHttp<S>>
where S::BaseUrlHttp: IsUnset,

Optional (Some / Option setters).

Source

pub fn base_url_ws( self, value: String, ) -> PolymarketDataClientConfigBuilder<SetBaseUrlWs<S>>
where S::BaseUrlWs: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_base_url_ws( self, value: Option<String>, ) -> PolymarketDataClientConfigBuilder<SetBaseUrlWs<S>>
where S::BaseUrlWs: IsUnset,

Optional (Some / Option setters).

Source

pub fn base_url_gamma( self, value: String, ) -> PolymarketDataClientConfigBuilder<SetBaseUrlGamma<S>>
where S::BaseUrlGamma: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_base_url_gamma( self, value: Option<String>, ) -> PolymarketDataClientConfigBuilder<SetBaseUrlGamma<S>>
where S::BaseUrlGamma: IsUnset,

Optional (Some / Option setters).

Source

pub fn base_url_data_api( self, value: String, ) -> PolymarketDataClientConfigBuilder<SetBaseUrlDataApi<S>>
where S::BaseUrlDataApi: IsUnset,

Optional (Some / Option setters).

Source

pub fn maybe_base_url_data_api( self, value: Option<String>, ) -> PolymarketDataClientConfigBuilder<SetBaseUrlDataApi<S>>
where S::BaseUrlDataApi: IsUnset,

Optional (Some / Option setters).

Source

pub fn http_timeout_secs( self, value: u64, ) -> PolymarketDataClientConfigBuilder<SetHttpTimeoutSecs<S>>
where S::HttpTimeoutSecs: IsUnset,

Optional (Some / Option setters). Default: 60.

HTTP timeout in seconds.

Source

pub fn maybe_http_timeout_secs( self, value: Option<u64>, ) -> PolymarketDataClientConfigBuilder<SetHttpTimeoutSecs<S>>
where S::HttpTimeoutSecs: IsUnset,

Optional (Some / Option setters). Default: 60.

HTTP timeout in seconds.

Source

pub fn ws_timeout_secs( self, value: u64, ) -> PolymarketDataClientConfigBuilder<SetWsTimeoutSecs<S>>
where S::WsTimeoutSecs: IsUnset,

Optional (Some / Option setters). Default: 30.

WebSocket timeout in seconds.

Source

pub fn maybe_ws_timeout_secs( self, value: Option<u64>, ) -> PolymarketDataClientConfigBuilder<SetWsTimeoutSecs<S>>
where S::WsTimeoutSecs: IsUnset,

Optional (Some / Option setters). Default: 30.

WebSocket timeout in seconds.

Source

pub fn ws_max_subscriptions( self, value: usize, ) -> PolymarketDataClientConfigBuilder<SetWsMaxSubscriptions<S>>
where S::WsMaxSubscriptions: IsUnset,

Optional (Some / Option setters). Default: crate::common::consts::WS_DEFAULT_SUBSCRIPTIONS.

Source

pub fn maybe_ws_max_subscriptions( self, value: Option<usize>, ) -> PolymarketDataClientConfigBuilder<SetWsMaxSubscriptions<S>>
where S::WsMaxSubscriptions: IsUnset,

Optional (Some / Option setters). Default: crate::common::consts::WS_DEFAULT_SUBSCRIPTIONS.

Source

pub fn update_instruments_interval_mins( self, value: u64, ) -> PolymarketDataClientConfigBuilder<SetUpdateInstrumentsIntervalMins<S>>
where S::UpdateInstrumentsIntervalMins: IsUnset,

Optional (Some / Option setters). Default: 60.

Instrument reload interval in minutes.

Source

pub fn maybe_update_instruments_interval_mins( self, value: Option<u64>, ) -> PolymarketDataClientConfigBuilder<SetUpdateInstrumentsIntervalMins<S>>
where S::UpdateInstrumentsIntervalMins: IsUnset,

Optional (Some / Option setters). Default: 60.

Instrument reload interval in minutes.

Source

pub fn subscribe_new_markets( self, value: bool, ) -> PolymarketDataClientConfigBuilder<SetSubscribeNewMarkets<S>>
where S::SubscribeNewMarkets: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to subscribe to new market discovery events via WebSocket.

Source

pub fn maybe_subscribe_new_markets( self, value: Option<bool>, ) -> PolymarketDataClientConfigBuilder<SetSubscribeNewMarkets<S>>
where S::SubscribeNewMarkets: IsUnset,

Optional (Some / Option setters). Default: false.

Whether to subscribe to new market discovery events via WebSocket.

Source

pub fn auto_load_missing_instruments( self, value: bool, ) -> PolymarketDataClientConfigBuilder<SetAutoLoadMissingInstruments<S>>
where S::AutoLoadMissingInstruments: IsUnset,

Optional (Some / Option setters). Default: true.

Whether subscribe and request commands referencing an unknown instrument should trigger an ad-hoc load via the instrument provider. Concurrent misses within auto_load_debounce_ms are coalesced into a single batched request.

Source

pub fn maybe_auto_load_missing_instruments( self, value: Option<bool>, ) -> PolymarketDataClientConfigBuilder<SetAutoLoadMissingInstruments<S>>
where S::AutoLoadMissingInstruments: IsUnset,

Optional (Some / Option setters). Default: true.

Whether subscribe and request commands referencing an unknown instrument should trigger an ad-hoc load via the instrument provider. Concurrent misses within auto_load_debounce_ms are coalesced into a single batched request.

Source

pub fn auto_load_debounce_ms( self, value: u64, ) -> PolymarketDataClientConfigBuilder<SetAutoLoadDebounceMs<S>>
where S::AutoLoadDebounceMs: IsUnset,

Optional (Some / Option setters). Default: 100.

The window (milliseconds) over which concurrent auto-load requests are batched.

Source

pub fn maybe_auto_load_debounce_ms( self, value: Option<u64>, ) -> PolymarketDataClientConfigBuilder<SetAutoLoadDebounceMs<S>>
where S::AutoLoadDebounceMs: IsUnset,

Optional (Some / Option setters). Default: 100.

The window (milliseconds) over which concurrent auto-load requests are batched.

Source

pub fn filters( self, value: Vec<Arc<dyn InstrumentFilter>>, ) -> PolymarketDataClientConfigBuilder<SetFilters<S>>
where S::Filters: IsUnset,

Optional (Some / Option setters). Default: <Vec<Arc<dyn InstrumentFilter>> as Default>::default().

Instrument filters applied to all instruments during loading and discovery.

Source

pub fn maybe_filters( self, value: Option<Vec<Arc<dyn InstrumentFilter>>>, ) -> PolymarketDataClientConfigBuilder<SetFilters<S>>
where S::Filters: IsUnset,

Optional (Some / Option setters). Default: <Vec<Arc<dyn InstrumentFilter>> as Default>::default().

Instrument filters applied to all instruments during loading and discovery.

Source

pub fn new_market_filter( self, value: Arc<dyn InstrumentFilter>, ) -> PolymarketDataClientConfigBuilder<SetNewMarketFilter<S>>
where S::NewMarketFilter: IsUnset,

Optional (Some / Option setters). Optional filter applied to newly discovered markets before instrument emission.

Source

pub fn maybe_new_market_filter( self, value: Option<Arc<dyn InstrumentFilter>>, ) -> PolymarketDataClientConfigBuilder<SetNewMarketFilter<S>>
where S::NewMarketFilter: IsUnset,

Optional (Some / Option setters). Optional filter applied to newly discovered markets before instrument emission.

Source

pub fn transport_backend( self, value: TransportBackend, ) -> PolymarketDataClientConfigBuilder<SetTransportBackend<S>>
where S::TransportBackend: IsUnset,

Optional (Some / Option setters). Default: <TransportBackend as Default>::default().

WebSocket transport backend (defaults to Tungstenite).

Source

pub fn maybe_transport_backend( self, value: Option<TransportBackend>, ) -> PolymarketDataClientConfigBuilder<SetTransportBackend<S>>
where S::TransportBackend: IsUnset,

Optional (Some / Option setters). Default: <TransportBackend as Default>::default().

WebSocket transport backend (defaults to Tungstenite).

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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> Same for T

Source§

type Output = T

Should always be Self
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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> Ungil for T
where T: Send,