Struct quire::validate::Structure [−][src]
pub struct Structure<'a> { /* fields omitted */ }
Structure validator
In yaml terms this validates that value is a map (or a null value, if all defaults are okay).
Additionally this validator allows to parse some scalar and convert it to the structure. This feature is useful to upgrade scalar value to a structure maintaining backwards compatiblity as well as for configuring common case more easily.
Methods
impl<'a> Structure<'a>
[src]
impl<'a> Structure<'a>
pub fn new() -> Structure<'a>
[src]
pub fn new() -> Structure<'a>
pub fn member<S: Display, V: Validator + 'a>(
self,
name: S,
value: V
) -> Structure<'a>
[src]
pub fn member<S: Display, V: Validator + 'a>(
self,
name: S,
value: V
) -> Structure<'a>
pub fn optional(self) -> Structure<'a>
[src]
pub fn optional(self) -> Structure<'a>
pub fn parser(
self,
f: fn(scalar: Ast) -> BTreeMap<String, Ast>
) -> Structure<'a>
[src]
pub fn parser(
self,
f: fn(scalar: Ast) -> BTreeMap<String, Ast>
) -> Structure<'a>
Trait Implementations
impl<'a> Debug for Structure<'a>
[src]
impl<'a> Debug for Structure<'a>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Validator for Structure<'a>
[src]
impl<'a> Validator for Structure<'a>