Skip to main content

Round

Derive Macro Round 

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

Round derive macro. for each method, the derive implementation maps each field using the method.

§Generics

For types with generic parameters, Round 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(Round)]
#[derive_bound(Round; T: Round)]
struct Fun<T>(T);