pub trait Add {
type Rhs;
type Output;
}
pub trait Sub {
type Rhs;
type Output;
}
pub trait Mul {
type Rhs;
type Output;
}
pub trait Div {
type Rhs;
type Output;
}
macro_rules! numeric_type {
($($tpe: ident),*) => {
$(
impl Add for super::$tpe {
type Rhs = super::$tpe;
type Output = super::$tpe;
}
impl Sub for super::$tpe {
type Rhs = super::$tpe;
type Output = super::$tpe;
}
impl Mul for super::$tpe {
type Rhs = super::$tpe;
type Output = super::$tpe;
}
impl Div for super::$tpe {
type Rhs = super::$tpe;
type Output = super::$tpe;
}
)*
}
}
numeric_type!(SmallInt, Integer, BigInt, Float, Double, Numeric);
impl Add for super::Timestamp {
type Rhs = super::Interval;
type Output = super::Timestamp;
}
impl Sub for super::Timestamp {
type Rhs = super::Interval;
type Output = super::Timestamp;
}
impl Add for super::Date {
type Rhs = super::Interval;
type Output = super::Timestamp;
}
impl Sub for super::Date {
type Rhs = super::Interval;
type Output = super::Timestamp;
}