pub struct DataConfig {
pub base_url: String,
pub clob_base_url: String,
pub timeout: Duration,
pub user_agent: String,
}Available on crate feature
client only.Expand description
Data API configuration
Fields§
§base_url: StringBase URL for the Data API
clob_base_url: StringCLOB API base URL
timeout: DurationRequest timeout
user_agent: StringUser agent string
Implementations§
Source§impl DataConfig
impl DataConfig
Sourcepub fn with_base_url(self, url: impl Into<String>) -> Self
pub fn with_base_url(self, url: impl Into<String>) -> Self
Set base URL
Sourcepub fn with_clob_base_url(self, url: impl Into<String>) -> Self
pub fn with_clob_base_url(self, url: impl Into<String>) -> Self
Set CLOB base URL
Sourcepub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
Set request timeout
Sourcepub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
pub fn with_user_agent(self, user_agent: impl Into<String>) -> Self
Set user agent string
Sourcepub fn from_env() -> Self
👎Deprecated since 0.1.0: Use DataConfig::default() instead. URL overrides via POLYMARKET_DATA_URL and POLYMARKET_CLOB_URL env vars are already supported.
pub fn from_env() -> Self
Create config from environment variables.
Deprecated: Use DataConfig::default() instead.
The default implementation already supports env var overrides.
Trait Implementations§
Source§impl Clone for DataConfig
impl Clone for DataConfig
Source§fn clone(&self) -> DataConfig
fn clone(&self) -> DataConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DataConfig
impl Debug for DataConfig
Auto Trait Implementations§
impl Freeze for DataConfig
impl RefUnwindSafe for DataConfig
impl Send for DataConfig
impl Sync for DataConfig
impl Unpin for DataConfig
impl UnwindSafe for DataConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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