pub struct DataApiBuilder { /* private fields */ }Expand description
Builder for configuring Data API client
Implementations§
Source§impl DataApiBuilder
impl DataApiBuilder
Sourcepub fn base_url(self, url: impl Into<String>) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
Set base URL for the API
This covers every namespace except DataApi::pnl and
DataApi::rankings, which live on their own hosts and have their own
setters.
Sourcepub fn pnl_base_url(self, url: impl Into<String>) -> Self
pub fn pnl_base_url(self, url: impl Into<String>) -> Self
Set base URL for the PnL host (default:
https://user-pnl-api.polymarket.com)
Sourcepub fn rankings_base_url(self, url: impl Into<String>) -> Self
pub fn rankings_base_url(self, url: impl Into<String>) -> Self
Set base URL for the rankings host (default:
https://lb-api.polymarket.com)
Sourcepub fn timeout_ms(self, timeout: u64) -> Self
pub fn timeout_ms(self, timeout: u64) -> Self
Set request timeout in milliseconds
Sourcepub fn with_retry_config(self, config: RetryConfig) -> Self
pub fn with_retry_config(self, config: RetryConfig) -> Self
Set retry configuration for 429 responses
Sourcepub fn max_concurrent(self, max: usize) -> Self
pub fn max_concurrent(self, max: usize) -> Self
Set the maximum number of concurrent in-flight requests.
Default: 4. Prevents Cloudflare 1015 errors from request bursts.
Sourcepub fn build(self) -> Result<DataApi, DataApiError>
pub fn build(self) -> Result<DataApi, DataApiError>
Build the Data API client
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DataApiBuilder
impl RefUnwindSafe for DataApiBuilder
impl Send for DataApiBuilder
impl Sync for DataApiBuilder
impl Unpin for DataApiBuilder
impl UnsafeUnpin for DataApiBuilder
impl UnwindSafe for DataApiBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more