pub struct RingElement { /* private fields */ }Expand description
Element of the ring Z_m (integers modulo m).
Implementations§
Source§impl RingElement
impl RingElement
Sourcepub fn is_unit(&self) -> bool
pub fn is_unit(&self) -> bool
Check if this element is a unit (has multiplicative inverse). An element a is a unit iff gcd(a, m) = 1.
Sourcepub fn is_zero_divisor(&self) -> bool
pub fn is_zero_divisor(&self) -> bool
Check if this element is a zero divisor. An element a ≠ 0 is a zero divisor iff gcd(a, m) > 1.
Trait Implementations§
Source§impl Add for RingElement
impl Add for RingElement
Source§impl Clone for RingElement
impl Clone for RingElement
Source§fn clone(&self) -> RingElement
fn clone(&self) -> RingElement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RingElement
impl Debug for RingElement
Source§impl<'de> Deserialize<'de> for RingElement
impl<'de> Deserialize<'de> for RingElement
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for RingElement
impl Hash for RingElement
Source§impl Mul for RingElement
impl Mul for RingElement
Source§impl Neg for RingElement
impl Neg for RingElement
Source§impl PartialEq for RingElement
impl PartialEq for RingElement
Source§impl Serialize for RingElement
impl Serialize for RingElement
Source§impl Sub for RingElement
impl Sub for RingElement
impl Copy for RingElement
impl Eq for RingElement
impl StructuralPartialEq for RingElement
Auto Trait Implementations§
impl Freeze for RingElement
impl RefUnwindSafe for RingElement
impl Send for RingElement
impl Sync for RingElement
impl Unpin for RingElement
impl UnsafeUnpin for RingElement
impl UnwindSafe for RingElement
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more