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]
naive_date: NaiveDate
) -> Result<SolarDate, LunisolarError>
將無時區的 Chrono
年月日實體轉成 SolarDate
實體。
pub fn from_date<Tz: TimeZone>(
date: Date<Tz>
) -> Result<SolarDate, LunisolarError>
[src]
date: Date<Tz>
) -> Result<SolarDate, LunisolarError>
將有時區的 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]
solar_year: Y,
solar_month: SolarMonth,
solar_day: SolarDay
) -> Result<SolarDate, LunisolarError>
利用西曆的年月日來產生 SolarDate
實體。
pub fn from_ymd(
year: u16,
month: u8,
day: u8
) -> Result<SolarDate, LunisolarError>
[src]
year: u16,
month: u8,
day: u8
) -> Result<SolarDate, LunisolarError>
利用西曆的年月日來產生 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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for SolarDate
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<SolarDate> for SolarDate
[src]
impl StructuralEq for SolarDate
[src]
impl StructuralPartialEq for SolarDate
[src]
Auto Trait Implementations
impl RefUnwindSafe for SolarDate
impl Send for SolarDate
impl Sync for SolarDate
impl Unpin for SolarDate
impl UnwindSafe for SolarDate
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,