Trait snarkvm_circuit::One

source ·
pub trait One {
    type Boolean: BooleanTrait;

    // Required methods
    fn one() -> Self
       where Self: Sized;
    fn is_one(&self) -> Self::Boolean;
}
Expand description

Representation of the one value.

Required Associated Types§

Required Methods§

source

fn one() -> Selfwhere Self: Sized,

Returns a new one constant.

source

fn is_one(&self) -> Self::Boolean

Returns true if self is one.

Trait Implementations§

§

impl<E> Metrics<dyn One<Boolean = Boolean<E>>> for Field<E>where E: Environment,

§

type Case = ()

§

fn count( _parameter: &<Field<E> as Metrics<dyn One<Boolean = Boolean<E>>>>::Case ) -> Count

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

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

§

type Case = ()

§

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

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

impl<E> OutputMode<dyn One<Boolean = Boolean<E>>> for Field<E>where E: Environment,

§

type Case = ()

§

fn output_mode( _input: &<Field<E> as OutputMode<dyn One<Boolean = Boolean<E>>>>::Case ) -> Mode

Returns the mode of the output.
§

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

§

type Case = ()

§

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

Returns the mode of the output.

Implementations on Foreign Types§

§

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

§

type Boolean = Boolean<E>

§

fn one() -> Integer<E, I>

§

fn is_one(&self) -> <Integer<E, I> as One>::Boolean

Implementors§

§

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

§

type Boolean = Boolean<E>

§

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

§

type Boolean = Boolean<E>