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§

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl SchemaType for &str

source§

impl SchemaType for bool

source§

impl SchemaType for i8

source§

impl SchemaType for i16

source§

impl SchemaType for i32

source§

impl SchemaType for i64

source§

impl SchemaType for i128

source§

impl SchemaType for u8

source§

impl SchemaType for u16

source§

impl SchemaType for u32

source§

impl SchemaType for u64

source§

impl SchemaType for u128

source§

impl SchemaType for ()

source§

impl SchemaType for [u8]

source§

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

source§

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

source§

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

source§

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

source§

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

Implementors§