Enum snarkvm_console_program::Literal
source · [−]pub enum Literal<N: Network> {
}
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
sourceimpl<N: Network> Literal<N>
impl<N: Network> Literal<N>
sourcepub fn from_bits_le(variant: u8, bits_le: &[bool]) -> Result<Self>
pub fn from_bits_le(variant: u8, bits_le: &[bool]) -> Result<Self>
Initializes a new literal from a list of little-endian bits without trailing zeros.
sourcepub fn from_bits_be(variant: u8, bits_be: &[bool]) -> Result<Self>
pub fn from_bits_be(variant: u8, bits_be: &[bool]) -> Result<Self>
Initializes a new literal from a list of big-endian bits without leading zeros.
sourceimpl<N: Network> Literal<N>
impl<N: Network> Literal<N>
sourcepub fn size_in_bits(&self) -> u16
pub fn size_in_bits(&self) -> u16
Returns the number of bits of this literal.
Trait Implementations
sourceimpl<'de, N: Network> Deserialize<'de> for Literal<N>
impl<'de, N: Network> Deserialize<'de> for Literal<N>
sourcefn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the literal from a string or bytes.
sourceimpl<N: Network> Parser for Literal<N>
impl<N: Network> Parser for Literal<N>
sourcefn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a literal.
sourceimpl<N: Network> ToBits for &Literal<N>
impl<N: Network> ToBits for &Literal<N>
sourceimpl<N: Network> ToBits for Literal<N>
impl<N: Network> ToBits for Literal<N>
impl<N: Network> Eq for Literal<N>
Auto Trait Implementations
impl<N> RefUnwindSafe for Literal<N> where
N: RefUnwindSafe,
<N as Environment>::Field: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
impl<N> Send for Literal<N>
impl<N> Sync for Literal<N>
impl<N> Unpin for Literal<N> where
N: Unpin,
<N as Environment>::Field: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
impl<N> UnwindSafe for Literal<N> where
N: UnwindSafe,
<N as Environment>::Field: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.