pub enum CLType {
Show 23 variants
Bool,
I32,
I64,
U8,
U32,
U64,
U128,
U256,
U512,
Unit,
String,
Key,
URef,
PublicKey,
Option(Box<CLType>),
List(Box<CLType>),
ByteArray(u32),
Result {
ok: Box<CLType>,
err: Box<CLType>,
},
Map {
key: Box<CLType>,
value: Box<CLType>,
},
Tuple1([Box<CLType>; 1]),
Tuple2([Box<CLType>; 2]),
Tuple3([Box<CLType>; 3]),
Any,
}
Expand description
Casper types, i.e. types which can be stored and manipulated by smart contracts.
Provides a description of the underlying data type of a CLValue
.
Variants§
Bool
bool
primitive.
I32
i32
primitive.
I64
i64
primitive.
U8
u8
primitive.
U32
u32
primitive.
U64
u64
primitive.
U128
U128
large unsigned integer type.
U256
U256
large unsigned integer type.
U512
U512
large unsigned integer type.
Unit
()
primitive.
String
String
primitive.
Key
Key
system type.
URef
URef
system type.
PublicKey
PublicKey
system type.
Option(Box<CLType>)
Option
of a CLType
.
List(Box<CLType>)
Variable-length list of a single CLType
(comparable to a Vec
).
ByteArray(u32)
Fixed-length list of a single CLType
(comparable to a Rust array).
Result
Result
with Ok
and Err
variants of CLType
s.
Map
Map with keys of a single CLType
and values of a single CLType
.
Tuple1([Box<CLType>; 1])
1-ary tuple of a CLType
.
Tuple2([Box<CLType>; 2])
2-ary tuple of CLType
s.
Tuple3([Box<CLType>; 3])
3-ary tuple of CLType
s.
Any
Unspecified type.
Implementations§
Trait Implementations§
Source§impl DataSize for CLType
impl DataSize for CLType
Source§const IS_DYNAMIC: bool = true
const IS_DYNAMIC: bool = true
true
, the type has a heap size that can vary at runtime, depending on the actual value.Source§const STATIC_HEAP_SIZE: usize = 0usize
const STATIC_HEAP_SIZE: usize = 0usize
IS_DYNAMIC
is false, this is
the total amount of heap memory occupied by the value. Otherwise this is a lower bound.Source§fn estimate_heap_size(&self) -> usize
fn estimate_heap_size(&self) -> usize
Source§impl<'de> Deserialize<'de> for CLType
impl<'de> Deserialize<'de> for CLType
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>,
Source§impl JsonSchema for CLType
impl JsonSchema for CLType
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moreSource§impl Ord for CLType
impl Ord for CLType
Source§impl PartialOrd for CLType
impl PartialOrd for CLType
impl Eq for CLType
impl StructuralPartialEq for CLType
Auto Trait Implementations§
impl Freeze for CLType
impl RefUnwindSafe for CLType
impl Send for CLType
impl Sync for CLType
impl Unpin for CLType
impl UnwindSafe for CLType
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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<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