1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use crate::*;

#[derive(Clone, Debug, Default, PartialEq)]
pub struct BooleanType {
    pub default: Option<LiteralValue>,
}

impl BooleanType {
    /// Create a boolean schema with the provided default value.
    pub fn new(value: bool) -> Self {
        BooleanType {
            default: Some(LiteralValue::Bool(value)),
        }
    }
}

impl Schematic for bool {
    fn build_schema(mut schema: SchemaBuilder) -> Schema {
        schema.boolean_default()
    }
}