logo
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

Fields

ok: Box<CLType>
err: Box<CLType>

Result with Ok and Err variants of CLTypes.

Map

Fields

key: Box<CLType>
value: Box<CLType>

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 CLTypes.

Tuple3([Box<CLType>; 3])

3-ary tuple of CLTypes.

Any

Unspecified type.

Implementations

The len() of the Vec<u8> resulting from self.to_bytes().

Returns true if the CLType is Option.

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

Deserialize this value from the given Serde deserializer. Read more

Deserializes the slice into Self.

Deserializes the Vec<u8> into Self.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

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

Converts self into a target type. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into a target type. 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.