[−][src]Struct koyomi::Calendar
カレンダー
指定期間の日付を生成することができる
Methods
impl Calendar
[src]
pub fn new(from: Date, until: Date) -> KoyomiResult<Self>
[src]
カレンダーオブジェクトを生成する
Examples
use koyomi::{Calendar, Date}; let from = Date::from_ymd(2018, 1, 1).unwrap(); let until = Date::from_ymd(2018, 12, 31).unwrap(); let cal = Calendar::new(from, until); assert!(cal.is_ok()); let from = Date::from_ymd(2018, 12, 31).unwrap(); let until = Date::from_ymd(2018, 1, 1).unwrap(); let cal = Calendar::new(from, until); assert!(cal.is_err());
pub fn build<'a>() -> CalendarBuilder<'a>
[src]
カレンダーを生成するためのビルダーを返す
pub fn from(&self) -> String
[src]
開始日の文字列表現を返す
Examples
use koyomi::{Calendar, Date}; let from = Date::from_ymd(2018, 1, 1).unwrap(); let until = Date::from_ymd(2018, 12, 31).unwrap(); let cal = Calendar::new(from, until).unwrap(); assert_eq!(cal.from(), "2018-01-01");
pub fn make(&self) -> Vec<Date>
[src]
pub fn until(&self) -> String
[src]
終了日の文字列表現を返す
Examples
use koyomi::{Calendar, Date}; let from = Date::from_ymd(2018, 1, 1).unwrap(); let until = Date::from_ymd(2018, 12, 31).unwrap(); let cal = Calendar::new(from, until).unwrap(); assert_eq!(cal.until(), "2018-12-31");
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Calendar
impl Send for Calendar
impl Sync for Calendar
impl Unpin for Calendar
impl UnwindSafe for Calendar
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,
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, 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.
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>,