Skip to main content

Field

Trait Field 

Source
pub trait Field: Ring {
    // Required method
    fn inv(&self) -> Self;
}
Expand description

An instance of a mathematical Field.

This inherits from Ring, and requires the existence of multiplicative inverses as well.

§Properties

Implementations are expected to satisfy the usual field inverse laws:

  • all Ring laws hold,
  • 0.inv() = 0,
  • for any nonzero a, a * a.inv() = 1.

Required Methods§

Source

fn inv(&self) -> Self

The multiplicative inverse of an element.

For Additive::zero, this should return Additive::zero.

For any other element x, this should return an element y such that x * y is equal to Ring::one.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Field for F