Trait modicum::Constrain

source ·
pub trait Constrain<M: Modulus<Self>>
where Self: TryFrom<M>, <Self as TryFrom<M>>::Error: Debug,
{ // Required method fn constrain(self, modulus: M) -> Self; }
Expand description

A trait to constrain an integer to a modulus.

Required Methods§

source

fn constrain(self, modulus: M) -> Self

Constrain an integer to a modulus.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T, M> Constrain<M> for T
where T: Integer + TryFrom<M>, <T as TryFrom<M>>::Error: Debug, M: Modulus<T>,