pub trait Magnitude{
const NBITS: usize;
Show 15 methods
// Required methods
fn abs_diff(&self, rhs: &Self) -> Self;
fn wrapping_add(&self, rhs: &Self) -> Self;
fn wrapping_mul(&self, rhs: &Self) -> Self;
fn wrapping_sub(&self, rhs: &Self) -> Self;
fn checked_add(&self, rhs: &Self) -> Option<Self>;
fn checked_mul(&self, rhs: &Self) -> Option<Self>;
fn checked_sub(&self, rhs: &Self) -> Option<Self>;
fn checked_div(&self, rhs: &Self) -> Option<Self>;
fn checked_rem(&self, rhs: &Self) -> Option<Self>;
fn is_zero(&self) -> bool;
fn zero() -> Self;
fn to_field<F: FieldWitness>(&self) -> F;
fn of_field<F: FieldWitness>(field: F) -> Self;
// Provided methods
fn add_flagged(&self, rhs: &Self) -> (Self, bool) { ... }
fn sub_flagged(&self, rhs: &Self) -> (Self, bool) { ... }
}
Required Associated Constants§
Required Methods§
fn abs_diff(&self, rhs: &Self) -> Self
fn wrapping_add(&self, rhs: &Self) -> Self
fn wrapping_mul(&self, rhs: &Self) -> Self
fn wrapping_sub(&self, rhs: &Self) -> Self
fn checked_add(&self, rhs: &Self) -> Option<Self>
fn checked_mul(&self, rhs: &Self) -> Option<Self>
fn checked_sub(&self, rhs: &Self) -> Option<Self>
fn checked_div(&self, rhs: &Self) -> Option<Self>
fn checked_rem(&self, rhs: &Self) -> Option<Self>
fn is_zero(&self) -> bool
fn zero() -> Self
fn to_field<F: FieldWitness>(&self) -> F
fn of_field<F: FieldWitness>(field: F) -> Self
Provided Methods§
fn add_flagged(&self, rhs: &Self) -> (Self, bool)
fn sub_flagged(&self, rhs: &Self) -> (Self, bool)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.