PlutusDataJson

Trait PlutusDataJson 

Source
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§

Source

fn to_json(&self) -> Value

Source

fn from_json(value: &Value) -> Result<Self, WError>

Provided Methods§

Source

fn to_json_string(&self) -> String

Source

fn to_constr_field(&self) -> Vec<Value>

Source

fn from_json_string(json_str: &str) -> Result<Self, WError>

Source

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.

Implementations on Foreign Types§

Source§

impl PlutusDataJson for ()

Source§

impl PlutusDataJson for Box<Bool>

Source§

impl PlutusDataJson for Box<PlutusData>

Source§

impl PlutusDataJson for Box<ByteString>

Source§

impl PlutusDataJson for Box<Int>

Source§

impl PlutusDataJson for Box<Script>

Source§

impl PlutusDataJson for Box<VerificationKey>

Source§

impl<T1> PlutusDataJson for (T1,)
where T1: PlutusDataJson + Clone,

Source§

impl<T1, T2> PlutusDataJson for (T1, T2)

Source§

impl<T1, T2> PlutusDataJson for Box<(T1, T2)>

Source§

impl<T1, T2> PlutusDataJson for Box<ConstrFields<(T1, T2)>>

Source§

impl<T1, T2, T3> PlutusDataJson for (T1, T2, T3)

Source§

impl<T1, T2, T3> PlutusDataJson for Box<(T1, T2, T3)>

Source§

impl<T1, T2, T3> PlutusDataJson for Box<ConstrFields<(T1, T2, T3)>>

Source§

impl<T1, T2, T3, T4> PlutusDataJson for (T1, T2, T3, T4)

Source§

impl<T1, T2, T3, T4> PlutusDataJson for Box<(T1, T2, T3, T4)>

Source§

impl<T1, T2, T3, T4> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4)>>

Source§

impl<T1, T2, T3, T4, T5> PlutusDataJson for (T1, T2, T3, T4, T5)

Source§

impl<T1, T2, T3, T4, T5> PlutusDataJson for Box<(T1, T2, T3, T4, T5)>

Source§

impl<T1, T2, T3, T4, T5> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5)>>

Source§

impl<T1, T2, T3, T4, T5, T6> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6)>

Source§

impl<T1, T2, T3, T4, T5, T6> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)>>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> PlutusDataJson for Box<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)>

Source§

impl<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> PlutusDataJson for Box<ConstrFields<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)>>

Source§

impl<T> PlutusDataJson for Box<Constr0<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr1<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr2<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr3<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr4<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr5<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr6<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr7<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr8<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr9<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr10<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Box<Constr<T>>
where T: Clone + PlutusDataJson,

Source§

impl<T: PlutusDataJson + Clone> PlutusDataJson for Box<List<T>>

Implementors§

Source§

impl PlutusDataJson for Bool

Source§

impl PlutusDataJson for Credential

Source§

impl PlutusDataJson for PlutusData

Source§

impl PlutusDataJson for Address

Source§

impl PlutusDataJson for ByteString

Source§

impl PlutusDataJson for Int

Source§

impl PlutusDataJson for Script

Source§

impl PlutusDataJson for Value

Source§

impl PlutusDataJson for VerificationKey

Source§

impl<K, V> PlutusDataJson for Map<K, V>

Source§

impl<T> PlutusDataJson for Constr0<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr1<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr2<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr3<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr4<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr5<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr6<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr7<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr8<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr9<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr10<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Constr<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for List<T>
where T: Clone + PlutusDataJson,

Source§

impl<T> PlutusDataJson for Tuple<T>
where T: Clone + PlutusDataJson,