pub enum LiteralType {
Show 17 variants
Address,
Boolean,
Field,
Group,
I8,
I16,
I32,
I64,
I128,
U8,
U16,
U32,
U64,
U128,
Scalar,
Signature,
String,
}Variants§
Address
The Aleo address type.
Boolean
The boolean type.
Field
The field type (base field).
Group
The group type (affine).
I8
The 8-bit signed integer type.
I16
The 16-bit signed integer type.
I32
The 32-bit signed integer type.
I64
The 64-bit signed integer type.
I128
The 128-bit signed integer type.
U8
The 8-bit unsigned integer type.
U16
The 16-bit unsigned integer type.
U32
The 32-bit unsigned integer type.
U64
The 64-bit unsigned integer type.
U128
The 128-bit unsigned integer type.
Scalar
The scalar type (scalar field).
Signature
The signature type.
String
The string type.
Implementations§
Source§impl LiteralType
impl LiteralType
Sourcepub fn size_in_bits<N: Network>(&self) -> u16
pub fn size_in_bits<N: Network>(&self) -> u16
Returns the number of bits of this literal type.
For string literals, this method returns the maximum number of bits that can be stored in the string.
Source§impl LiteralType
impl LiteralType
Sourcepub fn size_in_bytes<N: Network>(&self) -> u16
pub fn size_in_bytes<N: Network>(&self) -> u16
Returns the number of bytes of this literal.
For string literals, this method returns the maximum number of bytes that can be stored in the string.
Trait Implementations§
Source§impl Clone for LiteralType
impl Clone for LiteralType
Source§fn clone(&self) -> LiteralType
fn clone(&self) -> LiteralType
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LiteralType
impl Debug for LiteralType
Source§impl<'de> Deserialize<'de> for LiteralType
impl<'de> Deserialize<'de> for LiteralType
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserializes the literal type from a string or bytes.
Source§impl Display for LiteralType
impl Display for LiteralType
Source§impl<N: Network> From<LiteralType> for PlaintextType<N>
impl<N: Network> From<LiteralType> for PlaintextType<N>
Source§fn from(literal: LiteralType) -> Self
fn from(literal: LiteralType) -> Self
Initializes a plaintext type from a literal type.
Source§impl FromBytes for LiteralType
impl FromBytes for LiteralType
Source§fn read_le<R: Read>(reader: R) -> IoResult<Self>
fn read_le<R: Read>(reader: R) -> IoResult<Self>
Self from reader as little-endian bytes.Source§fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
Self from a byte array in little-endian order.Source§fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
fn from_bytes_le_unchecked(bytes: &[u8]) -> Result<Self, Error>where
Self: Sized,
Self::from_bytes_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read moreSource§fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
fn read_le_unchecked<R>(reader: R) -> Result<Self, Error>
Self::read_le but avoids costly checks.
This shall only be called when deserializing from a trusted source, such as local storage. Read moreSource§impl FromPrimitive for LiteralType
impl FromPrimitive for LiteralType
Source§fn from_i64(n: i64) -> Option<Self>
fn from_i64(n: i64) -> Option<Self>
i64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u64(n: u64) -> Option<Self>
fn from_u64(n: u64) -> Option<Self>
u64 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_isize(n: isize) -> Option<Self>
fn from_isize(n: isize) -> Option<Self>
isize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i8(n: i8) -> Option<Self>
fn from_i8(n: i8) -> Option<Self>
i8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i16(n: i16) -> Option<Self>
fn from_i16(n: i16) -> Option<Self>
i16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i32(n: i32) -> Option<Self>
fn from_i32(n: i32) -> Option<Self>
i32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_i128(n: i128) -> Option<Self>
fn from_i128(n: i128) -> Option<Self>
i128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§fn from_usize(n: usize) -> Option<Self>
fn from_usize(n: usize) -> Option<Self>
usize to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u8(n: u8) -> Option<Self>
fn from_u8(n: u8) -> Option<Self>
u8 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u16(n: u16) -> Option<Self>
fn from_u16(n: u16) -> Option<Self>
u16 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u32(n: u32) -> Option<Self>
fn from_u32(n: u32) -> Option<Self>
u32 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned.Source§fn from_u128(n: u128) -> Option<Self>
fn from_u128(n: u128) -> Option<Self>
u128 to return an optional value of this type. If the
value cannot be represented by this type, then None is returned. Read moreSource§impl FromStr for LiteralType
impl FromStr for LiteralType
Source§impl Hash for LiteralType
impl Hash for LiteralType
Source§impl Parser for LiteralType
impl Parser for LiteralType
Source§fn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a literal type.
Source§impl PartialEq for LiteralType
impl PartialEq for LiteralType
Source§impl Sequence for LiteralType
impl Sequence for LiteralType
Source§impl Serialize for LiteralType
impl Serialize for LiteralType
Source§impl ToBytes for LiteralType
impl ToBytes for LiteralType
impl Copy for LiteralType
impl Eq for LiteralType
impl StructuralPartialEq for LiteralType
Auto Trait Implementations§
impl Freeze for LiteralType
impl RefUnwindSafe for LiteralType
impl Send for LiteralType
impl Sync for LiteralType
impl Unpin for LiteralType
impl UnwindSafe for LiteralType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
impl<'de, T> DeserializeExt<'de> for Twhere
T: DeserializeOwned,
fn take_from_value<D>(
value: &mut Value,
field: &str,
) -> Result<T, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more