1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! HTTP chunked-transfer streaming for TradeStation v3.
//!
//! TradeStation uses HTTP streaming (NOT WebSocket):
//! - Content-Type: `application/vnd.tradestation.streams.v3+json`
//! - Newline-delimited JSON objects
//! - `StreamStatus` messages signal snapshot boundaries (`EndSnapshot`) and
//! reconnect requests (`GoAway`)
//!
//! All stream methods return a [`BoxStream`] of typed updates that can be
//! consumed with `futures::StreamExt`.
//!
//! # Example
//!
//! ```no_run
//! # use tradestation_api::{Client, Credentials};
//! # async fn example(client: &mut Client) -> Result<(), Box<dyn std::error::Error>> {
//! use futures::StreamExt;
//!
//! let mut stream = client.stream_quotes(&["AAPL"]).await?;
//! while let Some(result) = stream.next().await {
//! let quote = result?;
//! if !quote.is_status() {
//! println!("{}: {}", quote.symbol.as_deref().unwrap_or("?"), quote.last.as_deref().unwrap_or("?"));
//! }
//! }
//! # Ok(())
//! # }
//! ```
use Stream;
use Pin;
use crateError;
pub use *;
/// Type alias for a boxed async stream of results.
///
/// All streaming methods return this type. Consume it with
/// `futures::StreamExt::next()`.
pub type BoxStream<T> = ;