MinuteHelper

Trait MinuteHelper 

Source
pub trait MinuteHelper {
    // Required methods
    fn add_minutes(&self, minute: u32) -> Self;
    fn add_minutes_opt(&self, minute: u32) -> Option<Self>
       where Self: Sized;
    fn begin_of_minute(&self) -> Self;
    fn diff_minutes(&self, other: &Self) -> i64;
    fn end_of_minute(&self) -> Self;
    fn is_same_minute(&self, other: &Self) -> bool;
    fn sub_minutes(&self, minute: u32) -> Self;
    fn sub_minutes_opt(&self, minute: u32) -> Option<Self>
       where Self: Sized;
}
Expand description

English: The helper of minute

中文: 分钟助手

Required Methods§

Source

fn add_minutes(&self, minute: u32) -> Self

English: Add the specified number of minutes

中文:加上指定的分钟数

Source

fn add_minutes_opt(&self, minute: u32) -> Option<Self>
where Self: Sized,

English: Add the specified number of minutes

中文:加上指定的分钟数

Source

fn begin_of_minute(&self) -> Self

English: Get the start of one minute

中文: 获取分钟的开始时间

Source

fn diff_minutes(&self, other: &Self) -> i64

English: Get the signed number of full minutes between the given dates.

中文:获取给定时间之间的分钟差

Source

fn end_of_minute(&self) -> Self

English: Get the end of one minute

中文: 获取分钟的结束时间

Source

fn is_same_minute(&self, other: &Self) -> bool

English: Is the same minute

中文: 判断两个时间是否在同一分钟

Source

fn sub_minutes(&self, minute: u32) -> Self

English: Subtract the specified number of minutes

中文:减去给定的分钟数

Source

fn sub_minutes_opt(&self, minute: u32) -> Option<Self>
where Self: Sized,

English: Subtract the specified number of minutes

中文:减去给定的分钟数

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.

Implementations on Foreign Types§

Source§

impl MinuteHelper for NaiveDateTime

Source§

fn add_minutes(&self, minute: u32) -> Self

Source§

fn add_minutes_opt(&self, minute: u32) -> Option<Self>
where Self: Sized,

Source§

fn begin_of_minute(&self) -> Self

Source§

fn diff_minutes(&self, other: &Self) -> i64

Source§

fn end_of_minute(&self) -> Self

Source§

fn is_same_minute(&self, other: &Self) -> bool

Source§

fn sub_minutes(&self, minute: u32) -> Self

Source§

fn sub_minutes_opt(&self, minute: u32) -> Option<Self>
where Self: Sized,

Implementors§