pub struct PolymarketGammaRawHttpClient { /* private fields */ }Expand description
Provides a raw HTTP client for the Polymarket Gamma API.
Handles HTTP transport for fetching market data from the public Gamma API. No authentication is required.
Implementations§
Source§impl PolymarketGammaRawHttpClient
impl PolymarketGammaRawHttpClient
Sourcepub fn new(
base_url: Option<String>,
timeout_secs: u64,
) -> StdResult<Self, HttpClientError>
pub fn new( base_url: Option<String>, timeout_secs: u64, ) -> StdResult<Self, HttpClientError>
Creates a new PolymarketGammaRawHttpClient.
§Errors
Returns an error if the HTTP client cannot be created.
Sourcepub async fn get_gamma_markets(
&self,
params: GetGammaMarketsParams,
) -> Result<Vec<GammaMarket>>
pub async fn get_gamma_markets( &self, params: GetGammaMarketsParams, ) -> Result<Vec<GammaMarket>>
Fetches markets from the Gamma API.
Handles both bare array and {"data": [...]} response schemas.
Sourcepub async fn get_gamma_market(&self, market_id: &str) -> Result<GammaMarket>
pub async fn get_gamma_market(&self, market_id: &str) -> Result<GammaMarket>
Fetches a single market by ID from the Gamma API.
Sourcepub async fn get_gamma_events_by_slug(
&self,
slug: &str,
) -> Result<Vec<GammaEvent>>
pub async fn get_gamma_events_by_slug( &self, slug: &str, ) -> Result<Vec<GammaEvent>>
Fetches events from the Gamma API GET /events?slug=.
Sourcepub async fn get_gamma_events(
&self,
params: GetGammaEventsParams,
) -> Result<Vec<GammaEvent>>
pub async fn get_gamma_events( &self, params: GetGammaEventsParams, ) -> Result<Vec<GammaEvent>>
Fetches events from the Gamma API GET /events with full query params.
Fetches available tags from the Gamma API GET /tags.
Sourcepub async fn get_public_search(
&self,
params: GetSearchParams,
) -> Result<SearchResponse>
pub async fn get_public_search( &self, params: GetSearchParams, ) -> Result<SearchResponse>
Searches the Gamma API via GET /public-search.
Trait Implementations§
Source§impl Clone for PolymarketGammaRawHttpClient
impl Clone for PolymarketGammaRawHttpClient
Source§fn clone(&self) -> PolymarketGammaRawHttpClient
fn clone(&self) -> PolymarketGammaRawHttpClient
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 moreAuto Trait Implementations§
impl Freeze for PolymarketGammaRawHttpClient
impl !RefUnwindSafe for PolymarketGammaRawHttpClient
impl Send for PolymarketGammaRawHttpClient
impl Sync for PolymarketGammaRawHttpClient
impl Unpin for PolymarketGammaRawHttpClient
impl UnsafeUnpin for PolymarketGammaRawHttpClient
impl !UnwindSafe for PolymarketGammaRawHttpClient
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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