Skip to main content

ParamType

Trait ParamType 

Source
pub trait ParamType {
    // Required method
    fn schema() -> Json;

    // Provided methods
    fn variants() -> Vec<(&'static str, Vec<ParamInfo>)> { ... }
    fn fields() -> Vec<ParamInfo> { ... }
}
Expand description

The JSON Schema of the type of a parameter.

Required Methods§

Source

fn schema() -> Json

The schema ({"type": "number"}, {"type": "array", "items": …}…).

Provided Methods§

Source

fn variants() -> Vec<(&'static str, Vec<ParamInfo>)>

The mappings a value of the type may be, by their type, each with its parameters (ParamInfo::variants): none by default.

Source

fn fields() -> Vec<ParamInfo>

The keys of a value of the type that is a mapping of parameters (ParamInfo::fields): none by default.

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 ParamType for String

Source§

impl ParamType for Value

Any JSON value: a constellation name or mapping, a code, a list of taps…

Source§

impl ParamType for bool

Source§

impl ParamType for f64

Source§

impl ParamType for i64

Source§

impl ParamType for u8

Source§

impl ParamType for u32

Source§

impl ParamType for u64

Source§

impl ParamType for usize

Source§

impl<T: ParamType, const N: usize> ParamType for [T; N]

Source§

impl<T: ParamType> ParamType for Option<T>

Source§

impl<T: ParamType> ParamType for Vec<T>

Implementors§