macro_rules! gen_trait_impl { ($type : ident, $type_prim : ty, $na_check : expr, $na_val : expr) => { ... }; }
Expand description
Generates an implementation of a number of Traits for the specified Type
This macro requires the following arguments:
$type
- The Type the Traits are implemented for$type_prim
- The primitive Rust scalar type that corresponds to$type
$na_check
- Closure that providesNA
-checking logic$na_val
- The Rust-native value that translates toNA
Example Usage:
ⓘ
gen_trait_impl!(Rint, i32, |x: &Rint| x.0 == i32::MIN, i32::MIN);
The ‘example usage’ implements the following trait definitions:
impl Clone for Rint
impl Copy for Rint
impl CanBeNA for Rint
// Includes doc testimpl Debug for Rint
impl PartialEq<Rint> for Rint
// Includes doc testimpl PartialEq<i32> for Rint
// Includes doc testimpl Default for Rint
// Includes doc test