pub trait Compare<Rhs = Self>where
    Rhs: ?Sized,{
    type Output;

    // Required methods
    fn is_less_than(&self, other: &Rhs) -> Self::Output;
    fn is_greater_than(&self, other: &Rhs) -> Self::Output;
    fn is_less_than_or_equal(&self, other: &Rhs) -> Self::Output;
    fn is_greater_than_or_equal(&self, other: &Rhs) -> Self::Output;
}
Expand description

Trait for comparator operations.

Required Associated Types§

type Output

Required Methods§

fn is_less_than(&self, other: &Rhs) -> Self::Output

Returns true if self is less than other.

fn is_greater_than(&self, other: &Rhs) -> Self::Output

Returns true if self is greater than other.

fn is_less_than_or_equal(&self, other: &Rhs) -> Self::Output

Returns true if self is less than or equal to other.

fn is_greater_than_or_equal(&self, other: &Rhs) -> Self::Output

Returns true if self is greater than or equal to other.

Trait Implementations§

source§

impl<E, I> Metrics<dyn Compare<Integer<E, I>, Output = Boolean<E>>> for Integer<E, I>where E: Environment, I: IntegerType,

§

type Case = (Mode, Mode)

source§

fn count( case: &<Integer<E, I> as Metrics<dyn Compare<Integer<E, I>, Output = Boolean<E>>>>::Case ) -> Count

Returns the number of constants, public inputs, private inputs, and constraints.
source§

impl<E, I> OutputMode<dyn Compare<Integer<E, I>, Output = Boolean<E>>> for Integer<E, I>where E: Environment, I: IntegerType,

§

type Case = (Mode, Mode)

source§

fn output_mode( case: &<Integer<E, I> as OutputMode<dyn Compare<Integer<E, I>, Output = Boolean<E>>>>::Case ) -> Mode

Returns the mode of the output.

Implementations on Foreign Types§

§

impl<E> Compare<Field<E>> for Field<E>where E: Environment,

§

fn is_less_than( &self, other: &Field<E> ) -> <Field<E> as Compare<Field<E>>>::Output

Returns true if self is less than other.

§

fn is_greater_than( &self, other: &Field<E> ) -> <Field<E> as Compare<Field<E>>>::Output

Returns true if self is greater than other.

§

fn is_less_than_or_equal( &self, other: &Field<E> ) -> <Field<E> as Compare<Field<E>>>::Output

Returns true if self is less than or equal to other.

§

fn is_greater_than_or_equal( &self, other: &Field<E> ) -> <Field<E> as Compare<Field<E>>>::Output

Returns true if self is greater than or equal to other.

§

type Output = Boolean<E>

§

impl<E> Compare<Scalar<E>> for Scalar<E>where E: Environment,

§

fn is_less_than( &self, other: &Scalar<E> ) -> <Scalar<E> as Compare<Scalar<E>>>::Output

Returns true if self is less than other.

§

fn is_greater_than( &self, other: &Scalar<E> ) -> <Scalar<E> as Compare<Scalar<E>>>::Output

Returns true if self is greater than other.

§

fn is_less_than_or_equal( &self, other: &Scalar<E> ) -> <Scalar<E> as Compare<Scalar<E>>>::Output

Returns true if self is less than or equal to other.

§

fn is_greater_than_or_equal( &self, other: &Scalar<E> ) -> <Scalar<E> as Compare<Scalar<E>>>::Output

Returns true if self is greater than or equal to other.

§

type Output = Boolean<E>

§

impl<E, I> Compare<Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

§

fn is_less_than( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare<Integer<E, I>>>::Output

Returns true if self is less than other.

§

fn is_greater_than( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare<Integer<E, I>>>::Output

Returns true if self is greater than other.

§

fn is_less_than_or_equal( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare<Integer<E, I>>>::Output

Returns true if self is less than or equal to other.

§

fn is_greater_than_or_equal( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare<Integer<E, I>>>::Output

Returns true if self is greater than or equal to other.

§

type Output = Boolean<E>

§

impl<E> Compare<Address<E>> for Address<E>where E: Environment,

§

fn is_less_than( &self, other: &Address<E> ) -> <Address<E> as Compare<Address<E>>>::Output

Returns true if self is less than other.

§

fn is_greater_than( &self, other: &Address<E> ) -> <Address<E> as Compare<Address<E>>>::Output

Returns true if self is greater than other.

§

fn is_less_than_or_equal( &self, other: &Address<E> ) -> <Address<E> as Compare<Address<E>>>::Output

Returns true if self is less than or equal to other.

§

fn is_greater_than_or_equal( &self, other: &Address<E> ) -> <Address<E> as Compare<Address<E>>>::Output

Returns true if self is greater than or equal to other.

§

type Output = Boolean<E>

source§

impl<E, I> Compare<Integer<E, I>> for Integer<E, I>where E: Environment, I: IntegerType,

source§

fn is_less_than( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare<Integer<E, I>>>::Output

Returns true if self is less than other.

source§

fn is_greater_than( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare<Integer<E, I>>>::Output

Returns true if self is greater than other.

source§

fn is_less_than_or_equal( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare<Integer<E, I>>>::Output

Returns true if self is less than or equal to other.

source§

fn is_greater_than_or_equal( &self, other: &Integer<E, I> ) -> <Integer<E, I> as Compare<Integer<E, I>>>::Output

Returns true if self is greater than or equal to other.

§

type Output = Boolean<E>

Implementors§

source§

impl<E> Compare<Address<E>> for snarkvm_circuit_types::Address<E>where E: Environment,

§

type Output = Boolean<E>

source§

impl<E> Compare<Field<E>> for snarkvm_circuit_types::Field<E>where E: Environment,

§

type Output = Boolean<E>

source§

impl<E> Compare<Scalar<E>> for snarkvm_circuit_types::Scalar<E>where E: Environment,

§

type Output = Boolean<E>