Enum snarkvm_circuit::Literal
source · pub enum Literal<A>where
A: Aleo,{
Show 16 variants
Address(Address<A>),
Boolean(Boolean<A>),
Field(Field<A>),
Group(Group<A>),
I8(Integer<A, i8>),
I16(Integer<A, i16>),
I32(Integer<A, i32>),
I64(Integer<A, i64>),
I128(Integer<A, i128>),
U8(Integer<A, u8>),
U16(Integer<A, u16>),
U32(Integer<A, u32>),
U64(Integer<A, u64>),
U128(Integer<A, u128>),
Scalar(Scalar<A>),
String(StringType<A>),
}
Expand description
The literal enum represents all supported circuit types in snarkVM.
Variants§
Address(Address<A>)
The Aleo address type.
Boolean(Boolean<A>)
The boolean type.
Field(Field<A>)
The field type (base field).
Group(Group<A>)
The group type (affine).
I8(Integer<A, i8>)
The 8-bit signed integer type.
I16(Integer<A, i16>)
The 16-bit signed integer type.
I32(Integer<A, i32>)
The 32-bit signed integer type.
I64(Integer<A, i64>)
The 64-bit signed integer type.
I128(Integer<A, i128>)
The 128-bit signed integer type.
U8(Integer<A, u8>)
The 8-bit unsigned integer type.
U16(Integer<A, u16>)
The 16-bit unsigned integer type.
U32(Integer<A, u32>)
The 32-bit unsigned integer type.
U64(Integer<A, u64>)
The 64-bit unsigned integer type.
U128(Integer<A, u128>)
The 128-bit unsigned integer type.
Scalar(Scalar<A>)
The scalar type (scalar field).
String(StringType<A>)
The string type.
Implementations§
source§impl<A> Literal<A>where
A: Aleo,
impl<A> Literal<A>where A: Aleo,
sourcepub fn from_bits_le(
variant: &Integer<A, u8>,
bits_le: &[Boolean<A>]
) -> Literal<A>
pub fn from_bits_le( variant: &Integer<A, u8>, bits_le: &[Boolean<A>] ) -> Literal<A>
Initializes a new literal from a list of little-endian bits without trailing zeros.
sourcepub fn from_bits_be(
variant: &Integer<A, u8>,
bits_be: &[Boolean<A>]
) -> Literal<A>
pub fn from_bits_be( variant: &Integer<A, u8>, bits_be: &[Boolean<A>] ) -> Literal<A>
Initializes a new literal from a list of big-endian bits without leading zeros.
source§impl<A> Literal<A>where
A: Aleo,
impl<A> Literal<A>where A: Aleo,
sourcepub fn size_in_bits(&self) -> Integer<A, u16>
pub fn size_in_bits(&self) -> Integer<A, u16>
Returns the number of bits of this literal.
Trait Implementations§
source§impl<A> Eject for Literal<A>where
A: Aleo,
impl<A> Eject for Literal<A>where A: Aleo,
source§fn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the literal.
source§fn eject_value(&self) -> <Literal<A> as Eject>::Primitive
fn eject_value(&self) -> <Literal<A> as Eject>::Primitive
Ejects the literal into its primitive.
type Primitive = Literal<<A as Environment>::Network>
source§fn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
source§fn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant.source§fn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private.source§impl<A> Equal<Literal<A>> for Literal<A>where
A: Aleo,
impl<A> Equal<Literal<A>> for Literal<A>where A: Aleo,
source§fn is_equal(
&self,
other: &Literal<A>
) -> <Literal<A> as Equal<Literal<A>>>::Output
fn is_equal( &self, other: &Literal<A> ) -> <Literal<A> as Equal<Literal<A>>>::Output
Returns true
if self
and other
are equal.
source§fn is_not_equal(
&self,
other: &Literal<A>
) -> <Literal<A> as Equal<Literal<A>>>::Output
fn is_not_equal( &self, other: &Literal<A> ) -> <Literal<A> as Equal<Literal<A>>>::Output
Returns true
if self
and other
are not equal.