add VariantCount for IType and Value (#12)

This commit is contained in:
Valery Antopol
2021-09-01 13:29:00 +03:00
committed by GitHub
parent 138bbaf8bd
commit f0c93d9423
5 changed files with 21 additions and 6 deletions

View File

@ -1,6 +1,6 @@
[package]
name = "fluence-it-types"
version = "0.3.0"
version = "0.3.1"
description = "Definitions of IValue and IType"
authors = ["Fluence Labs"]
edition = "2018"
@ -18,5 +18,7 @@ serde = { version = "1.0.118", features = ["derive", "rc"]}
nom = { version = "5.1", optional = true }
wast = { version = "8.0", optional = true }
variant_count = "1.1"
[features]
impls = ["nom", "wast"]

View File

@ -4,9 +4,9 @@ use crate::ne_vec::NEVec;
use serde::Deserialize;
use serde::Serialize;
use variant_count::VariantCount;
/// Represents the types supported by WIT.
#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize)]
#[derive(PartialEq, Eq, Debug, Clone, Hash, Serialize, Deserialize, VariantCount)]
pub enum IType {
/// Boolean.
Boolean,

View File

@ -2,8 +2,10 @@
use crate::ne_vec::NEVec;
use variant_count::VariantCount;
/// A WIT value.
#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, VariantCount)]
pub enum IValue {
/// Boolean value.
Boolean(bool),