1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use chrono::TimeZone;

#[derive(Debug, Clone)]
pub struct WithTimezone<Type, Timezone: TimeZone + Sync + Send>(pub Type, pub Timezone);

pub trait WithTimezoneTrait<Timezone: TimeZone + Sync + Send> {
    fn with_timezone(self, timezone: Timezone) -> WithTimezone<Self, Timezone>
    where
        Self: Sized,
    {
        WithTimezone(self, timezone)
    }
}

impl<T, Timezone: TimeZone + Sync + Send> WithTimezoneTrait<Timezone> for T {}