Trait snarkvm_wasm::traits::utilities::integer::Integer[][src]

pub trait Integer: Debug + Clone {
    type IntegerType;

    pub const SIZE: usize;

    pub fn constant(value: Self::IntegerType) -> Self;
pub fn one() -> Self;
pub fn zero() -> Self;
pub fn new(
        bits: Vec<Boolean, Global>,
        value: Option<Self::IntegerType>
    ) -> Self;
pub fn is_constant(&self) -> bool;
pub fn to_bits_le(&self) -> Vec<Boolean, Global>;
pub fn from_bits_le(bits: &[Boolean]) -> Self;
pub fn get_value(&self) -> Option<String>; pub fn result_is_constant(first: &Self, second: &Self) -> bool { ... } }

The interface for a singed or unsigned integer gadget.

Associated Types

Loading content...

Associated Constants

pub const SIZE: usize[src]

Loading content...

Required methods

pub fn constant(value: Self::IntegerType) -> Self[src]

pub fn one() -> Self[src]

pub fn zero() -> Self[src]

pub fn new(bits: Vec<Boolean, Global>, value: Option<Self::IntegerType>) -> Self[src]

pub fn is_constant(&self) -> bool[src]

Returns true if all bits in this Int are constant

pub fn to_bits_le(&self) -> Vec<Boolean, Global>[src]

pub fn from_bits_le(bits: &[Boolean]) -> Self[src]

pub fn get_value(&self) -> Option<String>[src]

Loading content...

Provided methods

pub fn result_is_constant(first: &Self, second: &Self) -> bool[src]

Returns true if both Int objects have constant bits

Loading content...

Implementors

impl Integer for Int8[src]

type IntegerType = i8

impl Integer for Int16[src]

type IntegerType = i16

impl Integer for Int32[src]

type IntegerType = i32

impl Integer for Int64[src]

type IntegerType = i64

impl Integer for Int128[src]

type IntegerType = i128

impl Integer for UInt8[src]

type IntegerType = u8

impl Integer for UInt16[src]

type IntegerType = u16

impl Integer for UInt32[src]

type IntegerType = u32

impl Integer for UInt64[src]

type IntegerType = u64

impl Integer for UInt128[src]

type IntegerType = u128

Loading content...