Skip to main content

Crate x_iztro

Crate x_iztro 

Source
Expand description

紫微斗数排盘核心库,移植自 JS iztro v2.5.8。

入口:by_solar / by_lunar 排盘,get_horoscope 计算运限, astrolabe_to_prompt / horoscope_to_prompt 生成 AI 分析文本。 排盘行为由 Config 的六个开关控制,默认与 JS iztro 一致。

Re-exports§

pub use astro::builder::by_lunar;
pub use astro::builder::by_solar;
pub use astro::horoscope::get_horoscope;
pub use astro::palace::get_five_elements_class;
pub use astro::palace::get_palace_names;
pub use astro::palace::get_soul_and_body;
pub use astro::query::get_major_star_by_lunar_date;
pub use astro::query::get_major_star_by_solar_date;
pub use astro::query::get_sign_by_lunar_date;
pub use astro::query::get_sign_by_solar_date;
pub use astro::query::get_zodiac_by_solar_date;
pub use data::stars::StarKey;
pub use error::BridgeError;
pub use error::IztroError;
pub use i18n::lookup::key_of;
pub use i18n::lookup::key_of_in;
pub use i18n::lookup::translate_key;
pub use i18n::translate_brightness;
pub use i18n::translate_earthly_branch;
pub use i18n::translate_five_elements_class;
pub use i18n::translate_gender;
pub use i18n::translate_heavenly_stem;
pub use i18n::translate_horoscope_name;
pub use i18n::translate_mutagen;
pub use i18n::translate_palace;
pub use i18n::translate_sign;
pub use i18n::translate_star;
pub use i18n::translate_time;
pub use i18n::translate_zodiac;
pub use models::astrolabe::Astrolabe;
pub use models::astrolabe::PalaceRef;
pub use models::astrolabe::PalaceTarget;
pub use models::astrolabe::RawChineseDate;
pub use models::astrolabe::RawDates;
pub use models::astrolabe::RawLunarDate;
pub use models::astrolabe::StarRef;
pub use models::horoscope::AgeItem;
pub use models::horoscope::HoroscopeData;
pub use models::horoscope::HoroscopeItem;
pub use models::horoscope::HoroscopeRef;
pub use models::horoscope::YearlyDecStar;
pub use models::horoscope::YearlyItem;
pub use models::palace::Decadal;
pub use models::palace::PalaceData;
pub use models::star::Star;
pub use models::surpalaces::SurroundedPalaces;
pub use prompt::astrolabe_to_prompt;
pub use prompt::horoscope_to_prompt;
pub use data::types::*;

Modules§

astro
排盘与运限主流程
data
枚举、常量与星耀数据表
dto
跨语言绑定的序列化 DTO(camelCase + 翻译值 + 语言无关标识) JS iztro 兼容的序列化 DTO。
error
排盘入口的错误类型 排盘入口与绑定层的错误类型。
i18n
六语言词表与翻译入口 六语言词表与翻译入口。
models
星盘、宫位、星耀与运限的数据结构
prompt
AI 分析 Prompt 生成 AI 分析 Prompt 生成
star
安星算法 安星
utils
通用索引工具

Functions§

by_lunar_json
便捷函数:农历排盘并返回 JSON
by_solar_json
便捷函数:排盘并返回 JSON