csfloat_rs/lib.rs
1//! # CSFloat Async API Client (Unofficial)
2//!
3//! An **unofficial**, **asynchronous** Rust library for interacting with the [CSFloat](https://csfloat.com) API.
4//! This library provides full support for programmatic access to listings, buy orders, user data, exchange rates, and more.
5//! All prices returned by the server are in **cents**.
6//!
7//! ## Key Features
8//!
9//! * **Asynchronous design**: Built on `tokio` and `reqwest` for non-blocking I/O.
10//! * **Fetch listings**: Retrieve detailed listings with filters (price in cents, float, rarity, etc.).
11//! * **Buy orders**: Get and manage buy orders for specific items.
12//! * **User information**: Access your own profile, trades, and stall data.
13//! * **Listing management**: Create, delete, and modify listings and buy orders.
14//! * **Proxy support**: Optional SOCKS4/5 and HTTP(S) proxy support.
15//! * **Error handling**: Clear exceptions with descriptive messages.
16//!
17//! ## Quick Start
18//!
19//! ```no_run
20//! use csfloat_rs::Client;
21//!
22//! #[tokio::main]
23//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
24//! let client = Client::new("YOUR_API_KEY")?;
25//!
26//! // Fetch up to 50 listings priced between $1.00 and $10.00 (i.e., 100–1000 cents)
27//! let listings = client.get_all_listings()
28//! .min_price(100)
29//! .max_price(1000)
30//! .send()
31//! .await?;
32//!
33//! for listing in listings.listings {
34//! println!("ID: {}, Price: {} cents", listing.id, listing.price);
35//! }
36//!
37//! Ok(())
38//! }
39//! ```
40
41pub mod client;
42pub mod error;
43pub mod models;
44
45pub use client::Client;
46pub use error::{Error, Result};