Trait borsh::schema::BorshSchema[][src]

pub trait BorshSchema {
    fn add_definitions_recursively(
        definitions: &mut HashMap<Declaration, Definition>
    );
fn declaration() -> Declaration; fn add_definition(
        declaration: Declaration,
        definition: Definition,
        definitions: &mut HashMap<Declaration, Definition>
    ) { ... }
fn schema_container() -> BorshSchemaContainer { ... } }

The declaration and the definition of the type that can be used to (de)serialize Borsh without the Rust type that produced it.

Required methods

fn add_definitions_recursively(
    definitions: &mut HashMap<Declaration, Definition>
)
[src]

Recursively, using DFS, add type definitions required for this type. For primitive types this is an empty map. Type definition explains how to serialize/deserialize a type.

fn declaration() -> Declaration[src]

Get the name of the type without brackets.

Loading content...

Provided methods

fn add_definition(
    declaration: Declaration,
    definition: Definition,
    definitions: &mut HashMap<Declaration, Definition>
)
[src]

Helper method to add a single type definition to the map.

fn schema_container() -> BorshSchemaContainer[src]

Loading content...

Implementations on Foreign Types

impl BorshSchema for ()[src]

impl BorshSchema for bool[src]

impl BorshSchema for char[src]

impl BorshSchema for f32[src]

impl BorshSchema for f64[src]

impl BorshSchema for i8[src]

impl BorshSchema for i16[src]

impl BorshSchema for i32[src]

impl BorshSchema for i64[src]

impl BorshSchema for i128[src]

impl BorshSchema for u8[src]

impl BorshSchema for u16[src]

impl BorshSchema for u32[src]

impl BorshSchema for u64[src]

impl BorshSchema for u128[src]

impl<T> BorshSchema for [T; 0] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 1] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 2] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 3] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 4] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 5] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 6] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 7] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 8] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 9] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 10] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 11] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 12] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 13] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 14] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 15] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 16] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 17] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 18] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 19] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 32] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 64] where
    T: BorshSchema
[src]

impl<T> BorshSchema for [T; 65] where
    T: BorshSchema
[src]

impl<T> BorshSchema for Option<T> where
    T: BorshSchema
[src]

impl<T, E> BorshSchema for Result<T, E> where
    T: BorshSchema,
    E: BorshSchema
[src]

impl<T0, T1> BorshSchema for (T0, T1) where
    T0: BorshSchema,
    T1: BorshSchema
[src]

impl<T0, T1, T2> BorshSchema for (T0, T1, T2) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema
[src]

impl<T0, T1, T2, T3> BorshSchema for (T0, T1, T2, T3) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema
[src]

impl<T0, T1, T2, T3, T4> BorshSchema for (T0, T1, T2, T3, T4) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5> BorshSchema for (T0, T1, T2, T3, T4, T5) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6> BorshSchema for (T0, T1, T2, T3, T4, T5, T6) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema,
    T13: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema,
    T13: BorshSchema,
    T14: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema,
    T13: BorshSchema,
    T14: BorshSchema,
    T15: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema,
    T13: BorshSchema,
    T14: BorshSchema,
    T15: BorshSchema,
    T16: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema,
    T13: BorshSchema,
    T14: BorshSchema,
    T15: BorshSchema,
    T16: BorshSchema,
    T17: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema,
    T13: BorshSchema,
    T14: BorshSchema,
    T15: BorshSchema,
    T16: BorshSchema,
    T17: BorshSchema,
    T18: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema,
    T13: BorshSchema,
    T14: BorshSchema,
    T15: BorshSchema,
    T16: BorshSchema,
    T17: BorshSchema,
    T18: BorshSchema,
    T19: BorshSchema
[src]

impl<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20> BorshSchema for (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20) where
    T0: BorshSchema,
    T1: BorshSchema,
    T2: BorshSchema,
    T3: BorshSchema,
    T4: BorshSchema,
    T5: BorshSchema,
    T6: BorshSchema,
    T7: BorshSchema,
    T8: BorshSchema,
    T9: BorshSchema,
    T10: BorshSchema,
    T11: BorshSchema,
    T12: BorshSchema,
    T13: BorshSchema,
    T14: BorshSchema,
    T15: BorshSchema,
    T16: BorshSchema,
    T17: BorshSchema,
    T18: BorshSchema,
    T19: BorshSchema,
    T20: BorshSchema
[src]

Loading content...

Implementors

impl BorshSchema for Definition[src]

impl BorshSchema for Fields[src]

impl BorshSchema for String[src]

impl BorshSchema for BorshSchemaContainer where
    Declaration: BorshSchema,
    HashMap<Declaration, Definition>: BorshSchema
[src]

impl<K, V> BorshSchema for HashMap<K, V> where
    K: BorshSchema,
    V: BorshSchema
[src]

impl<T> BorshSchema for Box<T> where
    T: BorshSchema
[src]

impl<T> BorshSchema for Vec<T> where
    T: BorshSchema
[src]

Loading content...