pub enum Type {
Show 16 variants
Address,
Array(ArrayType),
Boolean,
Composite(CompositeType),
Field,
Future(FutureType),
Group,
Identifier(Identifier),
Integer(IntegerType),
Mapping(MappingType),
Scalar,
Signature,
String,
Tuple(TupleType),
Unit,
Err,
}
Expand description
Explicit type used for defining a variable or expression type
Variants§
Address
The address
type.
Array(ArrayType)
The array type.
Boolean
The bool
type.
Composite(CompositeType)
The struct
type.
Field
The field
type.
Future(FutureType)
The future
type.
Group
The group
type.
Identifier(Identifier)
A reference to a built in type.
Integer(IntegerType)
An integer type.
Mapping(MappingType)
A mapping type.
Scalar
The scalar
type.
Signature
The signature
type.
String
The string
type.
Tuple(TupleType)
A static tuple of at least one type.
Unit
The unit
type.
Err
Placeholder for a type that could not be resolved or was not well-formed. Will eventually lead to a compile error.
Implementations§
Source§impl Type
impl Type
Sourcepub fn eq_flat_relaxed(&self, other: &Self) -> bool
pub fn eq_flat_relaxed(&self, other: &Self) -> bool
Returns true
if the self Type
is equal to the other Type
in all aspects besides composite program of origin.
In the case of futures, it also makes sure that if both are not explicit, they are equal.
Flattens array syntax: [[u8; 1]; 2] == [u8; (2, 1)] == true
pub fn from_snarkvm<N: Network>( t: &PlaintextType<N>, program: Option<Symbol>, ) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Type
impl<'de> Deserialize<'de> for Type
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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