radion-sdk 0.9.0

Official, async-first, fully-typed Rust SDK for the Radion platform
Documentation
//! Official, async-first, fully-typed Rust SDK for the [Radion](https://radion.app) platform.
//!
//! One [`Radion`] client, one API key. Today the SDK exposes the realtime
//! (WebSocket) product surface and standalone [`webhooks`] helpers; further
//! surfaces attach to the same client as they ship, so adopting them is
//! purely additive.
//!
//! # Example
//!
//! ```no_run
//! use futures_util::StreamExt;
//! use radion_sdk::{Radion, realtime::{Channel, Payload, Subscription}};
//!
//! # async fn run() -> eyre::Result<()> {
//! let radion = Radion::builder().api_key("sk_...").build()?;
//! radion.realtime.connect().await?;
//!
//! let mut trades = radion.realtime.subscribe(Subscription::new("trading", Channel::Trading)).await?;
//! while let Some(event) = trades.next().await {
//!     if let Payload::Trading(trade) = event.data {
//!         println!("{} {:?}", event.id, trade);
//!     }
//! }
//! # Ok(())
//! # }
//! ```
//!
//! # Features
//!
//! - `realtime` *(default)* — the WebSocket product surface.
//! - `rustls` *(default)* — rustls TLS backend (no system OpenSSL dependency).
//! - `native-tls` — use the platform native TLS backend instead.
//! - `compression` — inflate zlib-compressed realtime frames. Opt in per client
//!   with `.compression(true)`.
//! - `tracing` — emit [`tracing`](https://docs.rs/tracing) spans/events.
//! - `webhooks` — consume webhook deliveries: signature verification and body
//!   parsing. No async transport — works in any HTTP server.
#![cfg_attr(docsrs, feature(doc_cfg))]
#![warn(missing_docs)]
#![forbid(unsafe_code)]

mod client;
mod config;
mod error;

pub use client::{Radion, RadionBuilder};
pub use config::{DEFAULT_BASE_URL, DEFAULT_WS_URL, RadionConfig};
pub use error::{RadionError, Result};

#[cfg(any(feature = "realtime", feature = "webhooks"))]
#[cfg_attr(docsrs, doc(cfg(any(feature = "realtime", feature = "webhooks"))))]
pub mod realtime;

#[cfg(feature = "webhooks")]
#[cfg_attr(docsrs, doc(cfg(feature = "webhooks")))]
pub mod webhooks;