[][src]Enum ergo_headless_dapp_framework::SType

pub enum SType {
    STypeVar(STypeVar),
    SAny,
    SBoolean,
    SByte,
    SShort,
    SInt,
    SLong,
    SBigInt,
    SGroupElement,
    SSigmaProp,
    SBox,
    SAvlTree,
    SOption(Box<SType, Global>),
    SColl(Box<SType, Global>),
    STup(Vec<SType, Global>),
    SFunc(Box<SFunc, Global>),
    SContext(SContext),
}

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

STup(Vec<SType, Global>)

Tuple (elements can have different types)

SFunc(Box<SFunc, Global>)

Function (signature)

SContext(SContext)

Context object ("CONTEXT" in ErgoScript)

Implementations

impl SType[src]

pub fn type_code(&self) -> TypeCode[src]

Type code used in serialization of SType values.

pub fn type_companion(&self) -> Option<Box<STypeCompanion, Global>>[src]

Get STypeCompanion instance associated with this SType

pub fn new_scoll(elem_type: SType) -> SType[src]

Create new SColl with the given element type

Trait Implementations

impl Clone for SType[src]

impl Debug for SType[src]

impl Eq for SType[src]

impl PartialEq<SType> for SType[src]

impl SigmaSerializable for SType[src]

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))

impl StructuralEq for SType[src]

impl StructuralPartialEq for SType[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<F> TryExtractInto<F> for F[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,