Skip to main content

QueryKind

Enum QueryKind 

Source
pub enum QueryKind {
    Natal(Query),
    Fortune {
        natal: Query,
        t_target: AskTime,
    },
    Event {
        t_ask: AskTime,
        seed: u64,
        q_text: Option<String>,
    },
    Election {
        window_start: AskTime,
        window_end: AskTime,
        category: String,
    },
    Synastry {
        a: Query,
        b: Query,
    },
    Mundane {
        p_polity: Query,
    },
    Locative {
        t_ask: AskTime,
        seed: u64,
        category: String,
    },
    Onomancy {
        name: String,
        surname_strokes: Option<u32>,
        given_strokes: Option<u32>,
    },
}
Expand description

问局(需求侧)分类,按「时间轴与切面」模型组织。

每变体携带其所需的输入原子;一切意图最终都映射到一组叶(由编排层的 route 在运行时定夺)。 Natal 直接复用 Query 作载荷——「一个时刻的切片」要的原子与共享输入恰好相同; 其余变体各携该类问局的最小输入原子。

Variants§

§

Natal(Query)

:本命盘——一个时刻的静态切片。

§

Fortune

:本命 + 目标时刻 → 运势/流年/dasha 定位。

Fields

§natal: Query

出生切片。

§t_target: AskTime

目标时刻(流年/大运扫描端点)。

§

Event

:占事(问事此刻 + 取机动作)。

Fields

§t_ask: AskTime

问事此刻。

§seed: u64

取机种子(摇钱/抽牌/数蓍/random 派生)。

§q_text: Option<String>

问句(只入释义不入算)。

§

Election

:时窗扫描 + 排序(择吉)。

Fields

§window_start: AskTime

时窗起。

§window_end: AskTime

时窗止。

§category: String

事类(婚/葬/动土/行/开业…)。

§

Synastry

:合盘(N=2 起,合婚/合伙)。

Fields

§a: Query

甲方本命。

§b: Query

乙方本命。

§

Mundane

群/国:政体奠基时刻 → 国运盘。

Fields

§p_polity: Query

政体奠基时刻(立国/开国大典/政权更替)。

§

Locative

:取方位(占课为主)。

Fields

§t_ask: AskTime

问事此刻。

§seed: u64

取机种子。

§category: String

事类(寻人/寻物/寻方向)。

§

Onomancy

:字/词模态(姓名笔画/字母值,与时刻无关)。

Fields

§name: String

姓名(数字学/gematria/abjad 字母值)。

§surname_strokes: Option<u32>

姓笔画(五格用,可选)。

§given_strokes: Option<u32>

名笔画(五格用,可选)。

Implementations§

Source§

impl QueryKind

Source

pub fn intent(&self) -> Intent

取本问局属于哪一类意图。

Source

pub fn id(&self) -> &'static str

取意图稳定 id。

Trait Implementations§

Source§

impl Clone for QueryKind

Source§

fn clone(&self) -> QueryKind

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for QueryKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for QueryKind

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for QueryKind

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.