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
//! Official Rust SDK for the [Forecite](https://forecite.dev) API — the scored
//! news feed (REST), the Verdict scoring engine, and the realtime WebSocket
//! stream. Async, built on `reqwest` + `tokio-tungstenite`.
//!
//! ```no_run
//! use forecite::{Forecite, FeedsQuery, StreamFilters, StreamEvent};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let forecite = Forecite::new("fc_live_your_key");
//!
//! // REST
//! let feeds = forecite
//! .feeds_list(&FeedsQuery { symbol: Some("TSLA".into()), limit: Some(20), ..Default::default() })
//! .await?;
//! println!("{} feeds", feeds.data.len());
//!
//! // Realtime
//! let filters = StreamFilters { symbols: Some(vec!["TSLA".into()]), ..Default::default() };
//! let mut stream = forecite.stream(&filters, 10).await?;
//! while let Some(event) = stream.next().await? {
//! if let StreamEvent::Feed { data, .. } = event {
//! println!("{:?}", data.title);
//! }
//! }
//! Ok(())
//! }
//! ```
pub use ;
pub use ForeciteError;
pub use ;
pub use *;