Skip to main content

Query

Struct Query 

Source
pub struct Query {
    pub year: i32,
    pub month: u32,
    pub day: u32,
    pub hour: u32,
    pub minute: u32,
    pub tz: f64,
    pub gender: Option<Gender>,
    pub latitude: Option<f64>,
    pub longitude: Option<f64>,
    pub seed: Option<u64>,
    pub name: Option<String>,
    pub schools: BTreeMap<String, String>,
}
Expand description

排盘查询(共享输入)。

Fields§

§year: i32

公历年。

§month: u32

公历月 1..12。

§day: u32

公历日 1..31。

§hour: u32

时 0..23。

§minute: u32

分 0..59。

§tz: f64

时区偏移小时(中国 +8,日本 +9)。

§gender: Option<Gender>

性别(可选)。

§latitude: Option<f64>

出生地纬度(度,北纬为正;占星 Asc/MC 需要,可选)。

§longitude: Option<f64>

出生地经度(度,东经为正;占星 Asc/MC 需要,可选)。

§seed: Option<u64>

C 族(抽样/起卦)的可复现种子;None 时由共享时刻派生(见 effective_seed)。

§name: Option<String>

姓名(D 族数字学用,可选)。拉丁字母按 Pythagorean/Chaldean 取值。

§schools: BTreeMap<String, String>

流派选择:key=叶 id,value=该叶选定的流派 id(见各叶 schools())。 缺省即按各叶 default = true 的流派算。同一次 cast_all 可为不同叶分别指定。

Implementations§

Source§

impl Query

Source

pub fn at( year: i32, month: u32, day: u32, hour: u32, minute: u32, tz: f64, ) -> Self

只带时刻的最小查询:性别 / 坐标 / 种子 / 姓名 / 流派全部缺省。

需要这些原子的叶自会在缺省下走它的降级路径(如八字不排大运、占星不出 Asc)。

Source

pub fn school_of<'a>(&'a self, engine_id: &str, default_id: &'a str) -> &'a str

取叶 engine_id 的流派 id。未指定时返回 default_id

Trait Implementations§

Source§

impl Clone for Query

Source§

fn clone(&self) -> Query

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 Query

Source§

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

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

impl<'de> Deserialize<'de> for Query

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 Query

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§

§

impl Freeze for Query

§

impl RefUnwindSafe for Query

§

impl Send for Query

§

impl Sync for Query

§

impl Unpin for Query

§

impl UnsafeUnpin for Query

§

impl UnwindSafe for Query

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.