rustyschwab 0.2.0

Unofficial Rust SDK for the Charles Schwab Trader and Market Data APIs: OAuth, REST, streaming, journaled orders, risk limits and a paper venue
Documentation
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc = include_str!("../README.md")]

/// Library version string in the format `rustyschwab X.Y.Z`.
///
/// # Example
/// ```
/// use rustyschwab::VERSION;
/// println!("Using {}", VERSION);
/// ```
pub const VERSION: &str = concat!("rustyschwab ", env!("CARGO_PKG_VERSION"));

pub mod audit_chain;
pub mod audit_delivery;
pub mod auth;
pub mod broker;
pub mod circuit_breaker;
pub mod client;
pub mod config;
pub mod coordination;
pub mod error;
pub mod execution;
pub mod history;
pub mod metrics;
pub mod paper;
pub mod performance;
pub mod readiness;
pub mod reconciliation;
pub mod recovery;
pub mod remote;
mod request_budget;
pub mod retry;
pub mod risk;
pub mod security;
#[cfg(windows)]
#[allow(unsafe_code)] // Win32 security FFI; each call carries a SAFETY note.
mod security_windows;
pub mod storage;
pub mod streaming;
#[cfg(feature = "telemetry")]
pub mod telemetry;
pub mod transport;
pub mod utils;

pub use auth::{AuthManager, AuthResult, OAuthConfig, TokenSet};
pub use circuit_breaker::{CircuitBreaker, CircuitState};
pub use client::{SchwabClient, SchwabClientBuilder};
pub use config::{ChannelKind, CircuitBreakerConfig, ClientConfig, SchwabConfig, StreamConfig};
pub use error::{Error, ErrorEnvelope, ErrorKind, Result};
pub use request_budget::RequestBudgetUsage;
pub use streaming::{MessageReceiver, StreamClient, StreamMessage, Subscription};

pub use rustyschwab_types as types;

/// Convenient re-exports for common Schwab SDK usage.
///
/// Use `use rustyschwab::prelude::*` to import the most commonly needed types.
pub mod prelude {
    pub use crate::auth::{AuthManager, OAuthConfig};
    pub use crate::client::{SchwabClient, SchwabClientBuilder};
    pub use crate::config::SchwabConfig;
    pub use crate::error::{Error, Result};
    pub use crate::streaming::{StreamClient, StreamMessage};
    pub use crate::types::*;
}