polyoxide_gamma/lib.rs
1//! # polyoxide-gamma
2//!
3//! Rust client library for Polymarket Gamma (market data) API.
4//!
5//! ## Features
6//!
7//! - Market data retrieval with filtering and pagination
8//! - Event and series (tournament/season) information
9//! - Tags and sports metadata
10//! - Comments on markets, events, and series
11//! - Type-safe API with idiomatic Rust patterns
12//! - Request builder pattern for flexible, composable queries
13//!
14//! ## Example
15//!
16//! ```no_run
17//! use polyoxide_gamma::Gamma;
18//!
19//! #[tokio::main]
20//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
21//! // Create a new Gamma client
22//! let gamma = Gamma::new()?;
23//!
24//! // List active markets with fluent builder pattern
25//! let markets = gamma.markets()
26//! .list()
27//! .open(true)
28//! .limit(10)
29//! .send()
30//! .await?;
31//!
32//! for market in markets {
33//! println!("Market: {}", market.question);
34//! }
35//!
36//! // Get a specific market by its numeric market id
37//! let market = gamma.markets()
38//! .get("123456")
39//! .send()
40//! .await?;
41//!
42//! Ok(())
43//! }
44//! ```
45
46/// Compiles the crate README's ```rust code blocks as doctests so broken
47/// examples fail CI. Only present during doctest builds; never affects
48/// normal compilation or `cargo doc` output.
49#[cfg(doctest)]
50#[doc = include_str!("../README.md")]
51struct ReadmeDoctests;
52
53pub mod api;
54pub mod client;
55pub mod error;
56pub mod types;
57
58pub use client::{Gamma, GammaBuilder};
59pub use error::GammaError;