pub trait Schematic {
// Required method
fn __type(
min_length: Option<u64>,
max_length: Option<u64>,
pattern: Option<String>,
format: Option<String>,
minimum: Option<i64>,
maximum: Option<i64>,
multiple_of: Option<i64>,
exclusive_minimum: Option<i64>,
exclusive_maximum: Option<i64>,
min_items: Option<usize>,
max_items: Option<usize>,
unique_items: Option<bool>,
) -> Type;
// Provided methods
fn __type_no_attr() -> Type { ... }
fn __defs() -> Definitions { ... }
fn __defs_map() -> DefinitionsMap { ... }
}
Expand description
A data structure that can provide any schema informations.
It is deprecated to implement this manually.
Rschema provides Schematic
implementations for some Rust primitive and standard library types. All of these can be used to generate schema using Rschema.
§Implementations of Schematic
provided by Rschema
- Primitive types:
- bool
- i8, i16, i32, i64, isize
- u8, u16, u32, u64, usize
- f32, f64
- char
- str(&str)
- Compound types:
- [T; N]
- tuples up to size 12
- Common standard library types:
- String
- Option<T>
- Wrapper types:
- Box<T>
- Collection types:
- HashMap<K, V, H>
- HashSet<T, H>
- Vec<T>
Required Methods§
fn __type( min_length: Option<u64>, max_length: Option<u64>, pattern: Option<String>, format: Option<String>, minimum: Option<i64>, maximum: Option<i64>, multiple_of: Option<i64>, exclusive_minimum: Option<i64>, exclusive_maximum: Option<i64>, min_items: Option<usize>, max_items: Option<usize>, unique_items: Option<bool>, ) -> Type
Provided Methods§
fn __type_no_attr() -> Type
fn __defs() -> Definitions
fn __defs_map() -> DefinitionsMap
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.