pub trait PlutusDataJson:
Clone
+ Debug
+ Sized {
// Required methods
fn to_json(&self) -> Value;
fn from_json(value: &Value) -> Result<Self, WError>;
// Provided methods
fn to_json_string(&self) -> String { ... }
fn to_constr_field(&self) -> Vec<Value> { ... }
fn from_json_string(json_str: &str) -> Result<Self, WError> { ... }
fn from_constr_field(fields: &Value) -> Result<Self, WError> { ... }
}Required Methods§
Provided Methods§
fn to_json_string(&self) -> String
fn to_constr_field(&self) -> Vec<Value>
fn from_json_string(json_str: &str) -> Result<Self, WError>
Sourcefn from_constr_field(fields: &Value) -> Result<Self, WError>
fn from_constr_field(fields: &Value) -> Result<Self, WError>
Parse from constructor fields array (the inverse of to_constr_field). Default implementation handles single-element arrays by extracting the first element.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.