pub enum SType {
Show 20 variants STypeVar(STypeVar), SAny, SBoolean, SByte, SShort, SInt, SLong, SBigInt, SGroupElement, SSigmaProp, SBox, SAvlTree, SOption(Box<SType, Global>), SColl(Box<SType, Global>), STuple(STuple), SFunc(SFunc), SContext, SHeader, SPreHeader, SGlobal,
}
Expand description

Every type descriptor is a tree represented by nodes in SType hierarchy.

Variants

STypeVar(STypeVar)

Type variable (generic)

SAny

TBD

SBoolean

Boolean

SByte

Signed byte

SShort

Signed short (16-bit)

SInt

Signed int (32-bit)

SLong

Signed long (64-bit)

SBigInt

256-bit integer

SGroupElement

Discrete logarithm prime-order group element [EcPoint]

SSigmaProp

Proposition which can be proven and verified by sigma protocol.

SBox

ErgoBox value

SAvlTree

AVL tree value

SOption(Box<SType, Global>)

Optional value

SColl(Box<SType, Global>)

Collection of elements of the same type

STuple(STuple)

Tuple (elements can have different types)

SFunc(SFunc)

Function (signature)

SContext

Context object (“CONTEXT” in ErgoScript)

SHeader

Header of a block

SPreHeader

Header of a block without solved mining puzzle

SGlobal

Data type introduced to unify handling of global and non-global (i.e. methods) operations.

Implementations

Check if type is numeric

Check if type is primitive

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

Performs the conversion.

Performs the conversion.

Performs the conversion.

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

This method tests for !=.

Each SType is serialized to array of bytes by:

  • emitting typeCode of each node (see special case for collections below)
  • then recursively serializing subtrees from left to right on each level
  • for each collection of primitive type there is special type code to emit single byte instead of two bytes Types code intervals
  • (1 .. MaxPrimTypeCode) // primitive types
  • (CollectionTypeCode .. CollectionTypeCode + MaxPrimTypeCode) // collections of primitive types
  • (MaxCollectionTypeCode ..) // Other types Collection of non-primitive type is serialized as (CollectionTypeCode, serialize(elementType))

Write self to the given writer. This function has a sigma_ prefix to alert the reader that the serialization in use is consensus-critical serialization Read more

Try to read self from the given reader. sigma- prefix to alert the reader that the serialization in use is consensus-critical Read more

Serialize any SigmaSerializable value into bytes

Parse self from the bytes

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 T using Into<T>. Read more

Compare self to key and return true if they are equal.

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

Performs the conversion.

Performs the conversion.

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Should always be Self

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased 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 T using TryInto<T>. Read more

Extract value of the given type from any type (e.g. [‘Constant’], [super::value::Value]) on which [TryExtractFrom] is implemented 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.