Macro struct_gen::impl_zero[][src]

macro_rules! impl_zero {
    (<$($lt: tt),+> , $t:ty, $e:expr) => { ... };
    ($t:ty, $e:expr) => { ... };
}

impl_zero! is a macro for implementing the Zero trait in an ergonomically friendly way.

impl_zero

This macro is used to generate all the base default cases for common/primitive types. It does this by implementing the Zero trait for these types, in an ergonomatically friendly way:

impl_zero!(TYPE, DEFAULT);

Example

impl_zero!(i32, 0);