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
//! `kundli-rs` computes a kundli from astronomical inputs.
//!
//! The most ergonomic entrypoints are [`calculate_kundli`] and the crate-root
//! re-exported request/config/result types. Use [`calculate_kundli_with_engine`]
//! when you want to inject a custom [`AstroEngine`] implementation for testing
//! or alternative data sources.
//!
//! # Quick start
//!
//! ```no_run
//! use kundli_rs::{AstroRequest, ChartLayer, ChartSpec, KundliConfig, calculate_kundli};
//!
//! let request = AstroRequest::new(2451545.0, 37.5665, 126.9780);
//!
//! let config = KundliConfig::from_request(&request).with_charts(&[
//! ChartSpec::d1(),
//! ChartSpec::d9(),
//! ChartSpec::vimshottari_dasha(),
//! ]);
//!
//! let result = calculate_kundli(request, config)?;
//! let d1 = result
//! .chart(ChartSpec::d1())
//! .and_then(ChartLayer::as_chart)
//! .unwrap();
//!
//! println!("Lagna sign: {:?}", d1.lagna.sign);
//! # Ok::<(), kundli_rs::KundliError>(())
//! ```
//!
//! # API overview
//!
//! A typical workflow is:
//!
//! 1. Build an [`AstroRequest`].
//! 2. Choose a [`KundliConfig`].
//! 3. Call [`calculate_kundli`] or [`calculate_kundli_with_engine`].
//! 4. Inspect the returned [`KundliResult`].
//!
//! [`AstroRequest`] and [`KundliConfig`] both carry zodiac, ayanamsha,
//! house-system, and node-type settings. Use [`KundliConfig::from_request`]
//! when you want those duplicated settings to match by construction.
pub use ;
pub use ;
pub use ;
pub use ;
pub use ;