Skip to main content

TypeMax

Derive Macro TypeMax 

Source
#[derive(TypeMax)]
{
    // Attributes available to this derive:
    #[derive_bound]
    #[type_max]
}
Expand description

TypeMax derive macro. Initializes the type_max of each field, and for enum requires a single variant to be labeled as type_max.

§Generics

For types with generic parameters, TypeMin will be implemented with no additional trait-bounds.

To add bounds to the derive, use the derive_bound attribute which follows this syntax: #[derive_bound(<trait-ident>; <where-predicate>, ...)].

§Example

use newnum::*;

#[derive(TypeMax)]
#[derive_bound(TypeMax; T: TypeMax)]
struct Fun<T>(T);