pub trait IsNullable {
const IS_NULLABLE: bool;
}
macro_rules! impl_is_nullable_not {
($($ty:ty,)* $(,)?) => {
$(
impl IsNullable for $ty {
const IS_NULLABLE: bool = false;
}
)*
};
}
impl_is_nullable_not!(
bool, char, f32, f64, i8, i16, i32, i64, u8, u16, u32, u64, String,
);
impl<T> IsNullable for Option<T> {
const IS_NULLABLE: bool = true;
}
impl<T: IsNullable> IsNullable for Vec<T> {
const IS_NULLABLE: bool = T::IS_NULLABLE;
}