pub struct ChartCalculationConfig {
pub solar_time: SolarTimePolicy,
pub year_boundary: YearBoundary,
pub leap_month_boundary: LeapMonthBoundary,
pub nominal_age_boundary: NominalAgeBoundary,
}Expand description
The input calculation policy applied before chart generation.
This is a separate axis from the algorithm family and the chart plane. With the default policy, the clock-time API derives the 时辰 from the supplied clock time and produces the same chart as the legacy time-index API for the same 时辰.
year_boundary and
leap_month_boundary affect natal chart
generation; nominal_age_boundary affects
runtime/horoscope nominal-age resolution only. All default to the values that
preserve existing iztro-rs behaviour and fixtures.
Fields§
§solar_time: SolarTimePolicyPolicy controlling how birth clock time becomes a 时辰.
year_boundary: YearBoundary年分界 policy controlling the effective cyclic birth year.
leap_month_boundary: LeapMonthBoundary闰月分界 policy controlling leap-month month attribution.
nominal_age_boundary: NominalAgeBoundary虚岁分界 policy controlling runtime nominal-age increments.
Implementations§
Source§impl ChartCalculationConfig
impl ChartCalculationConfig
Sourcepub const fn new(solar_time: SolarTimePolicy) -> Self
pub const fn new(solar_time: SolarTimePolicy) -> Self
Creates a calculation config from an explicit solar-time policy.
The boundary policies use their defaults
(YearBoundary::ChineseNewYearEve, LeapMonthBoundary::MidMonth,
NominalAgeBoundary::NaturalYear).
Sourcepub const fn clock_time() -> Self
pub const fn clock_time() -> Self
Creates the default clock-time calculation config.
Sourcepub const fn apparent_solar_time(config: ApparentSolarTimeConfig) -> Self
pub const fn apparent_solar_time(config: ApparentSolarTimeConfig) -> Self
Creates an apparent-solar-time calculation config.
Sourcepub const fn with_year_boundary(self, year_boundary: YearBoundary) -> Self
pub const fn with_year_boundary(self, year_boundary: YearBoundary) -> Self
Returns a copy with the 年分界 policy replaced.
Sourcepub const fn with_leap_month_boundary(
self,
leap_month_boundary: LeapMonthBoundary,
) -> Self
pub const fn with_leap_month_boundary( self, leap_month_boundary: LeapMonthBoundary, ) -> Self
Returns a copy with the 闰月分界 policy replaced.
Sourcepub const fn with_nominal_age_boundary(
self,
nominal_age_boundary: NominalAgeBoundary,
) -> Self
pub const fn with_nominal_age_boundary( self, nominal_age_boundary: NominalAgeBoundary, ) -> Self
Returns a copy with the 虚岁分界 policy replaced.
Trait Implementations§
Source§impl Clone for ChartCalculationConfig
impl Clone for ChartCalculationConfig
Source§fn clone(&self) -> ChartCalculationConfig
fn clone(&self) -> ChartCalculationConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ChartCalculationConfig
Source§impl Debug for ChartCalculationConfig
impl Debug for ChartCalculationConfig
Source§impl Default for ChartCalculationConfig
impl Default for ChartCalculationConfig
Source§fn default() -> ChartCalculationConfig
fn default() -> ChartCalculationConfig
Source§impl PartialEq for ChartCalculationConfig
impl PartialEq for ChartCalculationConfig
Source§fn eq(&self, other: &ChartCalculationConfig) -> bool
fn eq(&self, other: &ChartCalculationConfig) -> bool
self and other values to be equal, and is used by ==.