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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//! Official Rust client for the [finlight.me](https://finlight.me) API —
//! financial news with sentiment analysis, entity recognition, and real-time
//! streaming.
//!
//! Full API documentation: <https://docs.finlight.me>
//!
//! # Quick start
//!
//! ```no_run
//! use finlight_client::{Client, Config, GetArticlesParams};
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = Client::new(Config::new(std::env::var("FINLIGHT_API_KEY")?))?;
//!
//! let resp = client
//! .articles
//! .fetch_articles(&GetArticlesParams {
//! query: Some("nvidia".into()),
//! page_size: Some(10),
//! ..Default::default()
//! })
//! .await?;
//! for article in resp.articles {
//! println!("[{}] {}", article.source, article.title);
//! }
//! Ok(())
//! }
//! ```
//!
//! # Streaming
//!
//! ```no_run
//! use finlight_client::{Client, Config, GetArticlesWebSocketParams};
//! use futures_util::StreamExt;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = Client::new(Config::new(std::env::var("FINLIGHT_API_KEY")?))?;
//!
//! let mut stream = client.websocket.stream(GetArticlesWebSocketParams {
//! query: Some("nvidia".into()),
//! ..Default::default()
//! });
//! while let Some(article) = stream.next().await {
//! let article = article?; // Err is terminal (e.g. blocked by server)
//! println!("[{}] {}", article.source, article.title);
//! }
//! Ok(())
//! }
//! ```
pub use Client;
pub use Config;
pub use ;
pub use ;
pub use ;
pub use ;
pub use construct_webhook_event;
pub use ;