rust-rel8 0.1.4

Rel8 but in rust
Documentation
//! Helper trait that is used to mark if a type could be `NULL` on the SQL side.

/// Helper trait that is used to mark if a type could be `NULL` on the SQL side.
pub trait IsNullable {
    /// Is this type nullable
    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;
}