whisky_common/data/
constructors.rs

1use serde_json::{json, Value};
2
3pub fn con_str<N: Into<Value>, T: Into<Value>>(constructor: N, fields: T) -> Value {
4    json!({ "constructor": constructor.into(), "fields": fields.into() })
5}
6
7pub fn con_str0<T: Into<Value>>(fields: T) -> Value {
8    con_str(0, fields)
9}
10
11pub fn con_str1<T: Into<Value>>(fields: T) -> Value {
12    con_str(1, fields)
13}
14
15pub fn con_str2<T: Into<Value>>(fields: T) -> Value {
16    con_str(2, fields)
17}