1use std::marker::Send;
6use std::fmt::Debug;
7
8use chrono;
9use futures::Future;
10
11
12pub type SendBoxFuture<I, E> = Box<Future<Item=I, Error=E> + Send + 'static>;
14
15pub fn now() -> chrono::DateTime<chrono::Utc> {
17 chrono::Utc::now()
18}
19
20pub trait ConstSwitch: Debug + Copy + Send + Sync + 'static {
22 const ENABLED: bool;
23}
24
25#[derive(Debug, Copy, Clone)]
27pub struct Enabled;
28impl ConstSwitch for Enabled { const ENABLED: bool = true; }
29#[derive(Debug, Copy, Clone)]
31pub struct Disabled;
32impl ConstSwitch for Disabled { const ENABLED: bool = false; }
33