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
sourceimpl<A> Literal<A>where
A: Aleo,
impl<A> Literal<A>where
A: Aleo,
sourceimpl<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
sourceimpl<A> Eject for Literal<A>where
A: Aleo,
impl<A> Eject for Literal<A>where
A: Aleo,
sourcefn eject_mode(&self) -> Mode
fn eject_mode(&self) -> Mode
Ejects the mode of the literal.
sourcefn 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>
sourcefn eject(&self) -> (Mode, Self::Primitive)
fn eject(&self) -> (Mode, Self::Primitive)
sourcefn is_constant(&self) -> bool
fn is_constant(&self) -> bool
true
if the circuit is a constant. Read moresourcefn is_private(&self) -> bool
fn is_private(&self) -> bool
true
if the circuit is a private. Read moresourceimpl<A> Inject for Literal<A>where
A: Aleo,
impl<A> Inject for Literal<A>where
A: Aleo,
sourceimpl<A> ToBits for &Literal<A>where
A: Aleo,
impl<A> ToBits for &Literal<A>where
A: Aleo,
sourcefn to_bits_le(&self) -> Vec<Boolean<A>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn to_bits_le(&self) -> Vec<Boolean<A>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Returns the little-endian bits of the literal.
sourcefn to_bits_be(&self) -> Vec<Boolean<A>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn to_bits_be(&self) -> Vec<Boolean<A>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Returns the big-endian bits of the literal.
type Boolean = Boolean<A>
sourceimpl<A> ToBits for Literal<A>where
A: Aleo,
impl<A> ToBits for Literal<A>where
A: Aleo,
sourcefn to_bits_le(&self) -> Vec<Boolean<A>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn to_bits_le(&self) -> Vec<Boolean<A>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Returns the little-endian bits of the literal.
sourcefn to_bits_be(&self) -> Vec<Boolean<A>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
fn to_bits_be(&self) -> Vec<Boolean<A>, Global>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
Returns the big-endian bits of the literal.