pub trait QuarterHelper {
// Required methods
fn begin_of_quarter(&self) -> Self;
fn end_of_quarter(&self) -> Self;
fn is_same_quarter(&self, other: &Self) -> bool;
fn quarter(&self) -> Quarter;
fn add_quarters(&self, quarters: i32) -> Self;
fn add_quarters_opt(&self, quarters: i32) -> Option<Self>
where Self: Sized;
fn sub_quarters(&self, quarters: i32) -> Self;
fn sub_quarters_opt(&self, quarters: i32) -> Option<Self>
where Self: Sized;
fn diff_calendar_quarters(&self, other: &Self) -> i64;
fn diff_quarters(&self, other: &Self) -> i64;
}
Required Methods§
Sourcefn begin_of_quarter(&self) -> Self
fn begin_of_quarter(&self) -> Self
English: Get the first day of the quarter
中文: 获取季度的第一天
Sourcefn end_of_quarter(&self) -> Self
fn end_of_quarter(&self) -> Self
English: Get the last day of the quarter
中文: 获取季度的最后一天
Sourcefn is_same_quarter(&self, other: &Self) -> bool
fn is_same_quarter(&self, other: &Self) -> bool
English: Whether the two dates are in the same quarter
中文: 两个日期是否在同一个季度
Sourcefn add_quarters(&self, quarters: i32) -> Self
fn add_quarters(&self, quarters: i32) -> Self
English: Add the specified number of year quarters to the given date.
中文: 给定日期增加指定的年份季度数。
Sourcefn add_quarters_opt(&self, quarters: i32) -> Option<Self>where
Self: Sized,
fn add_quarters_opt(&self, quarters: i32) -> Option<Self>where
Self: Sized,
English: Add the specified number of year quarters to the given date.
中文: 给定日期增加指定的年份季度数。
Sourcefn sub_quarters(&self, quarters: i32) -> Self
fn sub_quarters(&self, quarters: i32) -> Self
English: Subtract the specified number of year quarters from the given date.
中文: 给定日期减去指定的年份季度数。
Sourcefn sub_quarters_opt(&self, quarters: i32) -> Option<Self>where
Self: Sized,
fn sub_quarters_opt(&self, quarters: i32) -> Option<Self>where
Self: Sized,
English: Subtract the specified number of year quarters from the given date.
中文: 给定日期减去指定的年份季度数。
Sourcefn diff_calendar_quarters(&self, other: &Self) -> i64
fn diff_calendar_quarters(&self, other: &Self) -> i64
English: Get the number of calendar quarters between the given dates.
中文: 获取两个日期之间的日历季度数。
Sourcefn diff_quarters(&self, other: &Self) -> i64
fn diff_quarters(&self, other: &Self) -> i64
English: Get the number of quarters between the given dates.
中文: 获取两个日期之间的季度数。
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.