Macro finite_fields::unit_nary [] [src]

macro_rules! unit_nary {
    ($tyname:ident, $arity:expr, $storsize:ident) => { ... };
}

A macro that defines a unit-width n-ary type as a newtype struct, with associated arithmetic traits. Used as a building block in other macros.

There are three arguments: $tyname, $arity and $storsize. $tyname is just the name of the resulting type. $arity defines the arity of the type (e.g. 2 for binary), while $storsize defines the storage type used to store the digit, since that is the underlying vocabulary Rust allows us to work with. So it must be a valid numeric type large enough to store the arity, and one that implements basic arithmetic (e.g., u8, u16).