pub enum Literal<N: Network> {
Show 16 variants Address(Address<N>), Boolean(Boolean<N>), Field(Field<N>), Group(Group<N>), I8(I8<N>), I16(I16<N>), I32(I32<N>), I64(I64<N>), I128(I128<N>), U8(U8<N>), U16(U16<N>), U32(U32<N>), U64(U64<N>), U128(U128<N>), Scalar(Scalar<N>), String(StringType<N>),
}
Expand description

The literal enum represents all supported types in snarkVM.

Variants§

§

Address(Address<N>)

The Aleo address type.

§

Boolean(Boolean<N>)

The boolean type.

§

Field(Field<N>)

The field type.

§

Group(Group<N>)

The group type.

§

I8(I8<N>)

The 8-bit signed integer type.

§

I16(I16<N>)

The 16-bit signed integer type.

§

I32(I32<N>)

The 32-bit signed integer type.

§

I64(I64<N>)

The 64-bit signed integer type.

§

I128(I128<N>)

The 128-bit signed integer type.

§

U8(U8<N>)

The 8-bit unsigned integer type.

§

U16(U16<N>)

The 16-bit unsigned integer type.

§

U32(U32<N>)

The 32-bit unsigned integer type.

§

U64(U64<N>)

The 64-bit unsigned integer type.

§

U128(U128<N>)

The 128-bit unsigned integer type.

§

Scalar(Scalar<N>)

The scalar type.

§

String(StringType<N>)

The string type.

Implementations§

Initializes a new literal from a list of little-endian bits without trailing zeros.

Initializes a new literal from a list of big-endian bits without leading zeros.

Returns a randomly-sampled literal of the given literal type.

Returns the number of bits of this literal.

Returns the type name of the literal.

Returns the variant of the literal.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Deserializes the literal from a string or bytes.

Formats the value using the given formatter. Read more

Returns true if self and other are equal.

Returns true if self and other are not equal.

Returns a new Plaintext from a Literal.

Returns a new Plaintext from a Literal.

Reads the literal from a buffer.

Returns Self from a byte array in little-endian order.

Parses a string into a literal.

The associated error which can be returned from parsing.
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more

Parses a string into a literal.

Returns true if self and other are equal.

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Serializes the literal into a string or as bytes.

Returns the little-endian bits of the literal.

Returns the big-endian bits of the literal.

Returns the little-endian bits of the literal.

Returns the big-endian bits of the literal.

Writes the literal to a buffer.

Returns self as a byte array in little-endian order.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Checks if this value is equivalent to the given key. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.