Skip to main content
← Back to kicad-monkey Rust Docs kicad-monkey Rust Crate API Reference

kicad_monkey_contracts/generated/
shaping_record.rs

1/// Error types.
2pub mod error {
3    /// Error from a `TryFrom` or `FromStr` implementation.
4    pub struct ConversionError(::std::borrow::Cow<'static, str>);
5    impl ::std::error::Error for ConversionError {}
6    impl ::std::fmt::Display for ConversionError {
7        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
8            ::std::fmt::Display::fmt(&self.0, f)
9        }
10    }
11    impl ::std::fmt::Debug for ConversionError {
12        fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> Result<(), ::std::fmt::Error> {
13            ::std::fmt::Debug::fmt(&self.0, f)
14        }
15    }
16    impl From<&'static str> for ConversionError {
17        fn from(value: &'static str) -> Self {
18            Self(value.into())
19        }
20    }
21    impl From<String> for ConversionError {
22        fn from(value: String) -> Self {
23            Self(value.into())
24        }
25    }
26}
27///`ExactComparisonPolicy`
28///
29/// <details><summary>JSON schema</summary>
30///
31/// ```json
32///{
33///  "type": "object",
34///  "required": [
35///    "mode"
36///  ],
37///  "properties": {
38///    "mode": {
39///      "type": "string",
40///      "const": "exact"
41///    }
42///  },
43///  "additionalProperties": false
44///}
45/// ```
46/// </details>
47#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
48#[serde(deny_unknown_fields)]
49pub struct ExactComparisonPolicy {
50    pub mode: ::std::string::String,
51}
52///Intermediate shaping oracle, intentionally separate from glyph outlines.
53///
54/// <details><summary>JSON schema</summary>
55///
56/// ```json
57///{
58///  "$id": "urn:wavenumber:schema:kicad_monkey.shaping_record:a0",
59///  "title": "Shaping record a0",
60///  "description": "Intermediate shaping oracle, intentionally separate from glyph outlines.",
61///  "type": "object",
62///  "required": [
63///    "case_id",
64///    "comparison",
65///    "glyphs",
66///    "input",
67///    "schema",
68///    "type",
69///    "version"
70///  ],
71///  "properties": {
72///    "case_id": {
73///      "$ref": "#/$defs/StableTextId"
74///    },
75///    "comparison": {
76///      "$ref": "#/$defs/ExactComparisonPolicy"
77///    },
78///    "glyphs": {
79///      "type": "array",
80///      "items": {
81///        "$ref": "#/$defs/ShapedGlyph"
82///      }
83///    },
84///    "input": {
85///      "$ref": "#/$defs/ShapingInput"
86///    },
87///    "schema": {
88///      "type": "string",
89///      "const": "kicad_monkey.shaping_record.a0"
90///    },
91///    "type": {
92///      "type": "string",
93///      "const": "kicad_monkey.shaping_record"
94///    },
95///    "version": {
96///      "type": "string",
97///      "const": "a0"
98///    }
99///  },
100///  "additionalProperties": false
101///}
102/// ```
103/// </details>
104#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
105#[serde(deny_unknown_fields)]
106pub struct ShapingRecordA0 {
107    pub case_id: crate::StableTextId,
108    pub comparison: ExactComparisonPolicy,
109    pub glyphs: ::std::vec::Vec<::cad_text_realization::ShapedGlyph>,
110    pub input: ::cad_text_realization::ShapingInput,
111    pub schema: ::std::string::String,
112    #[serde(rename = "type")]
113    pub type_: ::std::string::String,
114    pub version: ::std::string::String,
115}