Skip to main content

Crate qimen_core

Crate qimen_core 

Source
Expand description

Accurate, typed time-based Chai Bu rotating Qimen Dunjia charts.

Calendar calculation and plate construction are separated into independent crates. This crate adds the three wonders/six instruments, nine stars, eight doors, eight deities, duty star/door, void branches and travelling horse. Its output records conventions explicitly so another program can reproduce it.

let request = qimen_core::ChartRequest::new(2026, 9, 18, 14);
let chart = qimen_core::calculate(&request)?;
assert_eq!(chart.palaces.len(), 9);
assert_eq!(chart.schema_version, "1.1");

Structs§

BranchGrowth
One growth stage at one concrete palace branch.
CalculationRequest
The shared JSON/MCP request: civil fields plus optional extensions.
Calculator
A reusable deterministic calculator configured once for many civil inputs.
CalendarRequest
Proleptic Gregorian input and explicit calculation conventions.
CalendarResult
Calendar data required for a reproducible Qimen chart.
Chart
A complete, reproducible, language-independent Qimen chart.
ChartExtensions
Optional annotations. Absent fields were not requested, rather than negative.
CivilDateTime
An unambiguous second-resolution civil timestamp with a fixed UTC offset.
Conventions
Explicit conventions needed when comparing results between schools/software.
Cycle
A stem–branch pair within the sixty-position sexagenary cycle.
DayHorse
Optional day horse, independent of the existing hour-based palace marker.
DoorPressure
Door pressure for a single occupied door palace.
DoorPressures
Door-pressure results for all eight doors.
DoorStrength
Strength of a moving door.
ExtensionOptions
The optional annotations to calculate after constructing a base chart.
FourPillars
The four sexagenary pillars, with exact term boundaries for year and month.
GrowthStages
Twelve-stage results and the polarity/earth convention used.
HeavenStem
A heavenly-plate stem, including its provenance and center-hosting identity.
HiddenStem
A constructed hidden stem in one numeric palace.
HiddenStems
Nine-palace hidden-stem calculation and its actual starting point.
Horse
A travelling horse; its containing field identifies the source pillar.
Leaders
Duty star and duty door, preserving the original center palace when relevant.
LunarDate
Modern Chinese lunar-calendar rules applied to the local Gregorian date.
Palace
All fixed and moving components of one Luo Shu palace.
PalaceStrength
All strength annotations for a single palace.
PillarVoids
The two void branches of each pillar; palace markers use the hour pair.
Punishments
六仪击刑 evaluations, with plate identities retained.
SolarTerm
One solar-term boundary in the request’s fixed UTC offset.
StarStrength
Strength of a moving star under both explicitly recorded environments.
StemGrowth
Growth stages for one stem occurrence.
StemPlacement
Identity of a stem occurrence; hosted stems must not be silently collapsed.
StemPunishment
Punishment evaluation for one stem occurrence.
StemStrength
Strength of one stem occurrence.
StemTomb
Tomb evaluation for one stem occurrence.
Strengths
Strength annotations with the exact seasonal environment used.
Tombs
Tomb evaluations; applicability remains distinct from a negative result.
Xun
The hour’s ten-position period and its hidden 甲 stem.

Enums§

AnnotationBasis
The pillar used for a chart-level branch annotation.
Branch
The twelve earthly branches in their traditional order.
CalendarError
A rejected input or calendar conversion failure.
CenterPalaceRule
The supported center-palace convention.
DayBoundary
Civil-clock convention for the day pillar.
DayHorseRule
Supported day-horse conventions.
Deity
One of the eight deities, starting from the duty star’s current palace.
Direction
Palace directions on the Later Heaven / Luo Shu arrangement.
Door
One of the eight doors.
DoorPressureRule
Supported door-pressure conventions.
Dun
Yang or yin dun, determined by the current solar term.
Element
One of the five traditional elements.
ElementStrengthState
Ordinary five-element strength, used for doors and stems.
Error
An invalid calendar request, malformed JSON, or serialization failure.
GrowthRule
Supported twelve-stage growth conventions.
GrowthStage
One of the twelve stages of stem growth.
HiddenStemRule
Supported 暗干 construction conventions.
Method
A supported chart construction method.
PunishmentRule
Supported 六仪击刑 conventions.
Star
One of the nine stars; 天禽 is explicitly carried with 天芮.
StarStrengthState
Nine-star strength; 废 is distinct from the ordinary element’s 死.
Stem
The ten heavenly stems in their traditional order.
StemPlate
A plate carrying a stem annotation.
StrengthRule
Supported element-strength conventions.
TianQinRule
The supported placement of the central star.
TombRule
Supported stem-tomb conventions; these must not be conflated.
Trigram
One of the eight Later Heaven trigrams.
Yuan
The five-day yuan determined from the day’s 甲/己 head.

Constants§

SCHEMA_VERSION
Version of the serialized chart structure.

Functions§

calculate
Calculates the four pillars and complete nine-palace chart.
calculate_json
Parses a strict JSON request and returns a compact serialized chart.
calculate_json_pretty
Produces an indented JSON chart for human-readable command-line output.
calculate_with_options
Calculates a chart with per-call extension settings.

Type Aliases§

ChartRequest
Calendar input for the default time-based Chai Bu rotating chart.