Skip to main content

Subject

Enum Subject 

Source
pub enum Subject {
    Person,
    Company,
    Product,
    Event,
}
Expand description

主体类型:同一套四柱计算给不同主体读出不同象义。

计算层完全 DET 同源(干支/五行/十神/旺衰对任何主体一致); 只解读层换映射。person 是默认;company/product/event 适配「物有时刻 → 八字」(择日的逆运算)。

Variants§

§

Person

人(默认):传统人盘。年=祖根、月=父母青年、日=自身/配偶、时=子女晚年。

§

Company

公司/组织:年=创立根基/行业属性、月=成长环境/团队、日=主体/核心、时=前景/产出。

§

Product

物(有时刻发布的产品/建筑/开张):同公司盘(择日的镜像)。

§

Event

事(已发生事件):用于复盘事的性质与走向。

Implementations§

Source§

impl Subject

Source

pub fn from_str_opt(s: &str) -> Option<Self>

从字符串解析("person"/"company"/"product"/"event")。

首字母大写与中文都收,与 Gender 的别名一致——同一份请求里 gender"Male"subject 不收 "Person",宽严不一只会让人踩坑。 认不出的一律返回 None,由调用方拒绝,不当成没写

Source

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

中文展示名。

Trait Implementations§

Source§

impl Clone for Subject

Source§

fn clone(&self) -> Subject

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 Copy for Subject

Source§

impl Debug for Subject

Source§

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

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

impl Eq for Subject

Source§

impl PartialEq for Subject

Source§

fn eq(&self, other: &Subject) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Subject

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> 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.