pub trait SchemaType {
    // Required method
    fn get_type() -> Type;
}
Expand description

The SchemaType trait provides means to generate a schema for structures. Schemas are used to make structures human readable and to avoid dealing directly with bytes, such as the contract state or parameters for contract interaction.

Can be derived using #[derive(SchemaType)] for most cases of structs and enums.

Required Methods§

Implementations on Foreign Types§

source§

impl<T> SchemaType for Option<T>where T: SchemaType,

source§

impl<T> SchemaType for HashSet<T, BuildHasherDefault<FnvHasher>, Global>where T: SchemaType,

source§

impl SchemaType for u16

source§

impl SchemaType for i8

source§

impl<K, V> SchemaType for HashMap<K, V, BuildHasherDefault<FnvHasher>, Global>where K: SchemaType, V: SchemaType,

source§

impl<L, R> SchemaType for (L, R)where L: SchemaType, R: SchemaType,

source§

impl SchemaType for i32

source§

impl<A, const N: usize> SchemaType for [A; N]where A: SchemaType,

source§

impl SchemaType for [u8]

source§

impl SchemaType for u64

source§

impl SchemaType for i128

source§

impl SchemaType for u128

source§

impl SchemaType for u32

source§

impl SchemaType for ()

source§

impl SchemaType for i16

source§

impl SchemaType for u8

source§

impl SchemaType for bool

source§

impl SchemaType for i64

Implementors§