pub trait Data: Sized {
const TEXT: bool = false;
// Required methods
fn encode(&self) -> Json;
fn decode(json: &Json) -> Result<Self, DecodeError>;
}Expand description
A Rust type that a Flow data type maps to, converted under the encoding.
Provided Associated Constants§
Required Methods§
Sourcefn decode(json: &Json) -> Result<Self, DecodeError>
fn decode(json: &Json) -> Result<Self, DecodeError>
The value json encodes, or why it encodes none.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl Data for Infallible
Never, which has no values.
impl Data for Infallible
Never, which has no values.
Source§impl<A: Data, B: Data, C: Data, D: Data, E: Data, F: Data, G: Data, H: Data> Data for (A, B, C, D, E, F, G, H)
A tuple: an array of its elements.
impl<A: Data, B: Data, C: Data, D: Data, E: Data, F: Data, G: Data, H: Data> Data for (A, B, C, D, E, F, G, H)
A tuple: an array of its elements.
Source§impl<A: Data, B: Data, C: Data, D: Data, E: Data, F: Data, G: Data> Data for (A, B, C, D, E, F, G)
A tuple: an array of its elements.
impl<A: Data, B: Data, C: Data, D: Data, E: Data, F: Data, G: Data> Data for (A, B, C, D, E, F, G)
A tuple: an array of its elements.
Source§impl<A: Data, B: Data, C: Data, D: Data, E: Data, F: Data> Data for (A, B, C, D, E, F)
A tuple: an array of its elements.
impl<A: Data, B: Data, C: Data, D: Data, E: Data, F: Data> Data for (A, B, C, D, E, F)
A tuple: an array of its elements.
Source§impl<A: Data, B: Data, C: Data, D: Data, E: Data> Data for (A, B, C, D, E)
A tuple: an array of its elements.
impl<A: Data, B: Data, C: Data, D: Data, E: Data> Data for (A, B, C, D, E)
A tuple: an array of its elements.
Source§impl<A: Data, B: Data, C: Data, D: Data> Data for (A, B, C, D)
A tuple: an array of its elements.
impl<A: Data, B: Data, C: Data, D: Data> Data for (A, B, C, D)
A tuple: an array of its elements.
Source§impl<K: Data + Ord, V: Data> Data for BTreeMap<K, V>
Dict<K, V>: an object when the keys are Text, and otherwise an array
of [key, value] pairs in ascending key order. Two equal keys are
refused.
impl<K: Data + Ord, V: Data> Data for BTreeMap<K, V>
Dict<K, V>: an object when the keys are Text, and otherwise an array
of [key, value] pairs in ascending key order. Two equal keys are
refused.
Source§impl<T: Data + Ord> Data for BTreeSet<T>
Set<T>, in ascending order; repeated elements collapse.
impl<T: Data + Ord> Data for BTreeSet<T>
Set<T>, in ascending order; repeated elements collapse.
Source§impl<T: Data, E: Data> Data for Result<T, E>
Ordinary nested Result<T, E> data; Tool completion is a separate boundary.
impl<T: Data, E: Data> Data for Result<T, E>
Ordinary nested Result<T, E> data; Tool completion is a separate boundary.
Source§impl<T: Data> Data for Option<T>
Option<T> anywhere but a record field: "None" or {"Some": v}.
impl<T: Data> Data for Option<T>
Option<T> anywhere but a record field: "None" or {"Some": v}.