schwab 0.6.0

Unofficial Rust client library for the Schwab API, unaffiliated with Schwab brokerage or thinkorswim
Documentation
#![cfg_attr(docsrs, feature(doc_cfg))]
#![deny(missing_docs)]

//! Rust client library for the Schwab API.
//!
//! `schwab-rs` is an unofficial project. It is not affiliated with,
//! endorsed by, or sponsored by Charles Schwab & Co., Inc., Schwab brokerage
//! services, or thinkorswim.
//!
//! The OpenAPI files in `docs/` describe the Schwab HTTP API. This crate exposes
//! small client methods like `get_quotes(...)` instead of forcing callers to
//! build raw URLs and parse raw JSON.
//!
//! # Quotes example
//!
//! ```no_run
//! # async fn example() -> schwab::Result<()> {
//! use schwab::{Client, Config, QuoteOptions};
//!
//! let config = Config::new().base_url("http://127.0.0.1:8080/marketdata/v1")?;
//! let client = Client::new(config);
//!
//! let quotes = client
//!     .get_quotes_with_options(
//!         ["AAPL", "MSFT"],
//!         QuoteOptions::new().fields("quote,reference"),
//!     )
//!     .await?;
//!
//! if let Some(quote) = quotes.get("AAPL") {
//!     println!("AAPL quote: {:?}", quote);
//! }
//! # Ok(())
//! # }
//! ```

pub mod auth;

mod client;
mod config;
mod error;
mod market_data_api;
mod models;
// The options module shadows the `options` submodule inside models::streaming
// that is pulled into the public namespace by `pub use models::*`; the shadow
// is intentional and the re-export is still accessible as MoverOptions etc.
#[allow(hidden_glob_reexports)]
mod options;
mod order_builder;
mod query;
mod stream_session;
mod streaming_api;
mod trader_api;

pub use client::Client;
pub use config::Config;
pub use error::{Error, Result};
pub use models::*;
pub use options::{
    MoverOptions, OptionChainOptions, OrderListOptions, PriceHistoryOptions, QuoteOptions,
    TransactionListOptions,
};
pub use order_builder::OrderBuilder;
pub use stream_session::StreamingSession;

#[cfg(test)]
mod test_support;