Struct valico::json_dsl::Param
[−]
[src]
pub struct Param { pub name: String, pub coercer: Option<Box<Coercer + Send + Sync>>, pub nest: Option<Builder>, pub description: Option<String>, pub allow_null: bool, pub validators: Validators, pub default: Option<Value>, pub schema_builder: Option<Box<Fn(&mut Builder) + Send + Sync>>, pub schema_id: Option<Url>, }
Fields
name: String
coercer: Option<Box<Coercer + Send + Sync>>
nest: Option<Builder>
description: Option<String>
allow_null: bool
validators: Validators
default: Option<Value>
schema_builder: Option<Box<Fn(&mut Builder) + Send + Sync>>
schema_id: Option<Url>
Methods
impl Param
[src]
fn new(name: &str) -> Param
fn new_with_coercer(name: &str, coercer: Box<Coercer + Send + Sync>) -> Param
fn new_with_nest(
name: &str,
coercer: Box<Coercer + Send + Sync>,
nest: Builder
) -> Param
name: &str,
coercer: Box<Coercer + Send + Sync>,
nest: Builder
) -> Param
fn build<F>(name: &str, build_def: F) -> Param where
F: FnOnce(&mut Param),
F: FnOnce(&mut Param),
fn desc(&mut self, description: &str)
fn schema_id(&mut self, id: Url)
fn schema<F>(&mut self, build: F) where
F: Fn(&mut Builder) + 'static + Send + Sync,
F: Fn(&mut Builder) + 'static + Send + Sync,
fn coerce(&mut self, coercer: Box<Coercer + Send + Sync>)
fn nest<F>(&mut self, nest_def: F) where
F: FnOnce(&mut Builder) -> (),
F: FnOnce(&mut Builder) -> (),
fn allow_null(&mut self)
fn regex(&mut self, regex: Regex)
fn validate(&mut self, validator: Box<Validator + Send + Sync + 'static>)
fn validate_with<F>(&mut self, validator: F) where
F: Fn(&Value, &str) -> ValidatorResult + 'static + Send + Sync,
F: Fn(&Value, &str) -> ValidatorResult + 'static + Send + Sync,
fn process(
&self,
val: &mut Value,
path: &str,
scope: &Option<&Scope>
) -> ExtendedResult<Option<Value>>
&self,
val: &mut Value,
path: &str,
scope: &Option<&Scope>
) -> ExtendedResult<Option<Value>>