Struct chinese_lunisolar_calendar::SolarDate[][src]

pub struct SolarDate { /* fields omitted */ }

西曆年月日。

Implementations

impl SolarDate[src]

pub fn from_naive_date(
    naive_date: NaiveDate
) -> Result<SolarDate, LunisolarError>
[src]

將無時區的 Chrono 年月日實體轉成 SolarDate 實體。

pub fn from_date<Tz: TimeZone>(
    date: Date<Tz>
) -> Result<SolarDate, LunisolarError>
[src]

將有時區的 Chrono 年月日實體,依UTC時區轉成 SolarDate 實體。

pub fn to_naive_date(self) -> NaiveDate[src]

SolarDate 實體轉成無時區的 Chrono 年月日實體。

pub fn to_date_utc(self) -> Date<Utc>[src]

SolarDate 實體轉成UTC時區的 Chrono 年月日實體。

pub fn from_solar_year_month_day<Y: Into<SolarYear>>(
    solar_year: Y,
    solar_month: SolarMonth,
    solar_day: SolarDay
) -> Result<SolarDate, LunisolarError>
[src]

利用西曆的年月日來產生 SolarDate 實體。

pub fn from_ymd(
    year: u16,
    month: u8,
    day: u8
) -> Result<SolarDate, LunisolarError>
[src]

利用西曆的年月日來產生 SolarDate 實體。

pub fn from_lunisolar_date(lunisolar_date: LunisolarDate) -> SolarDate[src]

利用農曆年月日來產生 SolarDate 實體。

pub fn to_lunisolar_date(self) -> Result<LunisolarDate, LunisolarError>[src]

轉成農曆年月日。

pub fn now() -> Result<SolarDate, LunisolarError>[src]

以目前的年月日來產生 SolarDate 實體。

pub fn from_str<S: AsRef<str>>(s: S) -> Result<SolarDate, LunisolarError>[src]

用中文西曆年月日字串來產生 SolarDate 實體。

pub fn to_chinese_string(self) -> String[src]

取得 SolarDate 實體所代表的中文西曆年月日字串。以表示數字0

pub fn to_chinese_string_2(self) -> String[src]

取得 SolarDate 實體所代表的中文西曆年月日字串。以表示數字0

pub fn write_to_chinese_string(self, s: &mut String)[src]

取得 SolarDate 實體所代表的中文西曆年月日字串。以表示數字0

pub fn write_to_chinese_string_2(self, s: &mut String)[src]

取得 SolarDate 實體所代表的中文西曆年月日字串。以表示數字0

pub fn get_solar_year(self) -> SolarYear[src]

取得西曆年。

pub fn get_solar_month(self) -> SolarMonth[src]

取得西曆月。

pub fn get_solar_day(self) -> SolarDay[src]

取得西曆日。

pub fn the_n_day_in_this_year(self) -> u16[src]

計算此西曆年月日是該西曆年的第幾天。舉例:2013-01-04,就是第四天。

Trait Implementations

impl Clone for SolarDate[src]

impl Copy for SolarDate[src]

impl Debug for SolarDate[src]

impl Display for SolarDate[src]

impl Eq for SolarDate[src]

impl FromStr for SolarDate[src]

type Err = LunisolarError

The associated error which can be returned from parsing.

impl Hash for SolarDate[src]

impl PartialEq<SolarDate> for SolarDate[src]

impl StructuralEq for SolarDate[src]

impl StructuralPartialEq for SolarDate[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.