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
//! `divkit` — US equity dividends and dividend yield for Rust, from SEC EDGAR.
//!
//! Provides trailing-year annual dividend, dividend frequency, and yield
//! calculations sourced from EDGAR public-domain XBRL filings.
//!
//! # Quick start — free functions
//!
//! The simplest path: one call, no client to manage.
//!
//! ```no_run
//! use divkit::{annual_dividend_for, dividend_snapshot_for};
//!
//! #[tokio::main]
//! async fn main() -> divkit::Result<()> {
//! // Trailing 12-month dividend
//! if let Some(amt) = annual_dividend_for("KO").await? {
//! println!("KO annual dividend: ${amt:.4}");
//! }
//!
//! // Full snapshot — frequency, history, and yield
//! let snap = dividend_snapshot_for("KO").await?;
//! let yield_pct = snap.yield_on(64.50) * 100.0;
//! println!("KO dividend yield at $64.50: {yield_pct:.2}%");
//! Ok(())
//! }
//! ```
//!
//! # Client pattern (connection-pool reuse)
//!
//! Create [`Divkit`] once and reuse it across calls to share the internal
//! reqwest connection pool.
//!
//! ```no_run
//! use divkit::Divkit;
//!
//! #[tokio::main]
//! async fn main() -> divkit::Result<()> {
//! let client = Divkit::new();
//!
//! // Annual dividend (trailing 12 months)
//! if let Some(amt) = client.annual_dividend("KO").await? {
//! println!("KO: ${amt:.4}");
//! }
//!
//! // Snapshot with frequency detection and yield helper
//! let snap = client.dividend_snapshot("MSFT").await?;
//! println!("MSFT frequency: {:?}", snap.frequency());
//! println!("MSFT yield at $420: {:.2}%", snap.yield_on(420.0) * 100.0);
//! Ok(())
//! }
//! ```
pub use ;
pub use ;
pub use PriceProvider;
pub use ;
pub use ;
pub use DividendCache;