mirror of
https://github.com/fluencelabs/interface-types
synced 2024-12-04 15:20:20 +00:00
feat(interface-types) Make serde
optional behind a feature flag.
This commit is contained in:
parent
dc87c44d52
commit
d8c4d8fa83
@ -10,4 +10,11 @@ edition = "2018"
|
||||
[dependencies]
|
||||
nom = "5.1"
|
||||
wast = "8.0"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
|
||||
# `serde` is useful only to simplify the users' life. It is not
|
||||
# required by WIT itself, is is used to transform WIT values like
|
||||
# `record`s to Rust sum types.
|
||||
serde = { version = "1.0", features = ["derive"], optional = true }
|
||||
|
||||
[features]
|
||||
default = ["serde"]
|
@ -214,6 +214,7 @@ mod tests {
|
||||
])],
|
||||
);
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
#[test]
|
||||
#[allow(non_snake_case, unused)]
|
||||
fn test_record_lift__to_rust_struct() {
|
||||
|
@ -2,6 +2,8 @@
|
||||
//! types, and traits —basically this is the part a runtime should
|
||||
//! take a look to use the `wasmer-interface-types` crate—.
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
mod serde;
|
||||
|
||||
pub mod structures;
|
||||
pub mod values;
|
||||
|
@ -2,9 +2,11 @@
|
||||
|
||||
pub use crate::ast::{InterfaceType, RecordType};
|
||||
use crate::errors::WasmValueNativeCastError;
|
||||
pub use crate::interpreter::wasm::serde::*;
|
||||
use std::{convert::TryFrom, slice::Iter};
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
pub use crate::interpreter::wasm::serde::*;
|
||||
|
||||
/// A WIT value.
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum InterfaceValue {
|
||||
|
Loading…
Reference in New Issue
Block a user