pub struct TimeUnit { /* private fields */ }Implementations§
Source§impl TimeUnit
impl TimeUnit
Sourcepub fn is_convertible_to(&self, other: &Self) -> bool
pub fn is_convertible_to(&self, other: &Self) -> bool
この単位で表される値を、指定した単位に変換できるかどうかを検証する。 例えば、分単位はミリ秒単位に変換できるが、四半期単位は(一ヶ月の長さが毎月異なるため)日単位に変換できない。
param other 変換先単位
return 変換できる場合はtrue、そうでない場合はfalse
Sourcepub fn is_convertible_to_milliseconds(&self) -> bool
pub fn is_convertible_to_milliseconds(&self) -> bool
この単位で表される値を、ミリ秒単位に変換できるかどうかを検証する。 例えば、分単位はミリ秒単位に変換できるが、四半期単位は(一ヶ月の長さが毎月異なるため)ミリ秒単位に変換できない。
return 変換できる場合はtrue、そうでない場合はfalse
Sourcepub fn base_unit(&self) -> TimeUnit
pub fn base_unit(&self) -> TimeUnit
この単位の計数の基数とすることができる最小の単位を取得する。 例えば、分単位はミリ秒単位で計数できるが、四半期単位は(一ヶ月の長さが毎月異なるため)月単位までしか計数できない。
return この単位の計数の基数とすることができる最小の単位
pub fn descending_units(&self) -> Vec<TimeUnit>
pub fn descending_units_for_display(&self) -> Vec<TimeUnit>
pub fn next_finer_unit(&self) -> Option<TimeUnit>
Trait Implementations§
Source§impl Ord for TimeUnit
impl Ord for TimeUnit
Source§impl PartialOrd for TimeUnit
impl PartialOrd for TimeUnit
impl Eq for TimeUnit
impl StructuralPartialEq for TimeUnit
Auto Trait Implementations§
impl Freeze for TimeUnit
impl RefUnwindSafe for TimeUnit
impl Send for TimeUnit
impl Sync for TimeUnit
impl Unpin for TimeUnit
impl UnwindSafe for TimeUnit
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more