Period

Trait Period 

Source
pub trait Period:
    Debug
    + Send
    + Serialize
    + Deserialize {
    // Required methods
    fn contains(&self, date: Date<Utc>) -> bool;
    fn get_date_time_start(&self) -> DateTime<Utc>;
    fn starts_before(&self, date: Date<Utc>) -> bool;
    fn with_new_start(&self, date: Date<Utc>) -> Box<dyn Period>;
    fn cloned(&self) -> Box<dyn Period>;
    fn as_weekdays(&self) -> (u32, u32);
    fn as_days_of_month(&self) -> (u32, u32);
    fn as_months(&self) -> (u32, u32);
    fn with_new_month(&self, month: u32) -> Date<Utc>;
}

Required Methods§

Source

fn contains(&self, date: Date<Utc>) -> bool

Source

fn get_date_time_start(&self) -> DateTime<Utc>

Source

fn starts_before(&self, date: Date<Utc>) -> bool

Source

fn with_new_start(&self, date: Date<Utc>) -> Box<dyn Period>

Source

fn cloned(&self) -> Box<dyn Period>

Source

fn as_weekdays(&self) -> (u32, u32)

Source

fn as_days_of_month(&self) -> (u32, u32)

Source

fn as_months(&self) -> (u32, u32)

Source

fn with_new_month(&self, month: u32) -> Date<Utc>

Trait Implementations§

Source§

impl<'de> Deserialize<'de> for Box<dyn Period>

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'de> Deserialize<'de> for Box<dyn Period + Send>

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<'typetag> Serialize for dyn Period + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn Period + Send + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn Period + Send + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'typetag> Serialize for dyn Period + Sync + 'typetag

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Implementors§