Skip to main content

jacquard_api/pub_leaflet/blocks/
math.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: pub.leaflet.blocks.math
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8use jacquard_common::CowStr;
9
10#[allow(unused_imports)]
11use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
12use jacquard_derive::{IntoStatic, lexicon};
13use jacquard_lexicon::lexicon::LexiconDoc;
14use jacquard_lexicon::schema::LexiconSchema;
15
16#[allow(unused_imports)]
17use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
18use serde::{Serialize, Deserialize};
19
20#[lexicon]
21#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
22#[serde(rename_all = "camelCase")]
23pub struct Math<'a> {
24    #[serde(borrow)]
25    pub tex: CowStr<'a>,
26}
27
28impl<'a> LexiconSchema for Math<'a> {
29    fn nsid() -> &'static str {
30        "pub.leaflet.blocks.math"
31    }
32    fn def_name() -> &'static str {
33        "main"
34    }
35    fn lexicon_doc() -> LexiconDoc<'static> {
36        lexicon_doc_pub_leaflet_blocks_math()
37    }
38    fn validate(&self) -> Result<(), ConstraintError> {
39        Ok(())
40    }
41}
42
43fn lexicon_doc_pub_leaflet_blocks_math() -> LexiconDoc<'static> {
44    #[allow(unused_imports)]
45    use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
46    use jacquard_lexicon::lexicon::*;
47    use alloc::collections::BTreeMap;
48    LexiconDoc {
49        lexicon: Lexicon::Lexicon1,
50        id: CowStr::new_static("pub.leaflet.blocks.math"),
51        defs: {
52            let mut map = BTreeMap::new();
53            map.insert(
54                SmolStr::new_static("main"),
55                LexUserType::Object(LexObject {
56                    required: Some(vec![SmolStr::new_static("tex")]),
57                    properties: {
58                        #[allow(unused_mut)]
59                        let mut map = BTreeMap::new();
60                        map.insert(
61                            SmolStr::new_static("tex"),
62                            LexObjectProperty::String(LexString { ..Default::default() }),
63                        );
64                        map
65                    },
66                    ..Default::default()
67                }),
68            );
69            map
70        },
71        ..Default::default()
72    }
73}