Trait opendp::traits::AlertingMul
source · pub trait AlertingMul: Sized {
// Required method
fn alerting_mul(&self, v: &Self) -> Fallible<Self>;
}
Expand description
Fallible multiplication that returns an error if overflowing.
Avoids unrecoverable panics that could leak private information.
use opendp::traits::AlertingMul;
assert!(i8::MAX.alerting_mul(&2).is_err());
Required Methods§
sourcefn alerting_mul(&self, v: &Self) -> Fallible<Self>
fn alerting_mul(&self, v: &Self) -> Fallible<Self>
§Proof Definition
For any self
and v
of type Self
,
returns Ok(self * v)
if the result does not overflow, else Err(e)
Object Safety§
This trait is not object safe.