[−][src]Enum ergo_lib::types::stype::SType
Every type descriptor is a tree represented by nodes in SType hierarchy.
Variants
Type variable (generic)
TBD
Boolean
Signed byte
Signed short (16-bit)
Signed int (32-bit)
Signed long (64-bit)
256-bit integer
Discrete logarithm prime-order group element EcPoint
Proposition which can be proven and verified by sigma protocol.
ErgoBox value
AVL tree value
Optional value
Collection of elements of the same type
STuple(TupleItems<SType>)
Tuple (elements can have different types)
SFunc(Box<SFunc>)
Function (signature)
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>>
[src]
Get STypeCompanion instance associated with this SType
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))
pub fn sigma_serialize<W: SigmaByteWrite>(&self, w: &mut W) -> Result<(), Error>
[src]
pub fn sigma_parse<R: SigmaByteRead>(
r: &mut R
) -> Result<Self, SerializationError>
[src]
r: &mut R
) -> Result<Self, SerializationError>
pub fn sigma_serialize_bytes(&self) -> Vec<u8>
[src]
pub fn sigma_parse_bytes(mut bytes: Vec<u8>) -> Result<Self, SerializationError>
[src]
impl StructuralEq for SType
[src]
impl StructuralPartialEq for SType
[src]
Auto Trait Implementations
impl RefUnwindSafe for SType
[src]
impl Send for SType
[src]
impl Sync for SType
[src]
impl Unpin for SType
[src]
impl UnwindSafe for SType
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<F> TryExtractInto<F> for F
[src]
pub fn try_extract_into<T>(Self) -> Result<T, TryExtractFromError> where
T: TryExtractFrom<F>,
[src]
T: TryExtractFrom<F>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,