Module op_assign_macros

Module op_assign_macros 

Source
Expand description

A collection of macros designed to implement simple operations whose implementations are often boilerplate based off some other operation.

Macrosยง

impl_add_assign
Given a struct which implements Add implement AddAssign<T> for any type T which implements Into<Self>.
impl_add_base_field
Given two structs Alg and Field where Alg implements From<Field>, implement Add<Field> for Alg and Add<Alg> for Field.
impl_div_methods
Given two structs Alg and Field where Alg implements From<Field>, implement Div<Field> and DivAssign<Field> for Alg.
impl_mul_base_field
Given two structs Alg and Field where Alg implements From<Field>, implement Mul<Field> for Alg and Mul<Alg> for Field.
impl_mul_methods
Given a struct which implements Mul implement MulAssign<T> for any type T which implements Into<Self>.
impl_packed_value
Given Field and Algebra structs where Algebra is simply a wrapper around [Field; N] implement PackedValue for Algebra.
impl_rng
Given a struct Alg which is a wrapper over [Field; N] for some N, implement Distribution<Alg> for StandardUniform.
impl_sub_assign
Given a struct which implements Sub implement SubAssign<T> for any type T which implements Into<Self>.
impl_sub_base_field
Given two structs Alg and Field where Alg implements From<Field>, implement Sub<Field> for Alg and Sub<Alg> for Field.
impl_sum_prod_base_field
Given two structs Alg and Field where Alg implements From<Field>, implement Sum<Field> and Product<Field> for Alg.
ring_sum
Given a struct which implements Add implement Sum.