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

kicad_monkey_contracts/generated/
font_resolution_request.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///Selection metadata paired with a FontBundle and out-of-band buffers.
28///
29/// <details><summary>JSON schema</summary>
30///
31/// ```json
32///{
33///  "$id": "urn:wavenumber:schema:kicad_monkey.font_resolution.request:a0",
34///  "title": "Font resolution request a0",
35///  "description": "Selection metadata paired with a FontBundle and out-of-band buffers.",
36///  "type": "object",
37///  "required": [
38///    "schema",
39///    "selection",
40///    "type",
41///    "version"
42///  ],
43///  "properties": {
44///    "schema": {
45///      "type": "string",
46///      "const": "kicad_monkey.font_resolution_request.a0"
47///    },
48///    "selection": {
49///      "$ref": "#/$defs/FontSelection"
50///    },
51///    "type": {
52///      "type": "string",
53///      "const": "kicad_monkey.font_resolution_request"
54///    },
55///    "version": {
56///      "type": "string",
57///      "const": "a0"
58///    }
59///  },
60///  "additionalProperties": false
61///}
62/// ```
63/// </details>
64#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
65#[serde(deny_unknown_fields)]
66pub struct FontResolutionRequestA0 {
67    pub schema: ::std::string::String,
68    pub selection: FontSelection,
69    #[serde(rename = "type")]
70    pub type_: ::std::string::String,
71    pub version: ::std::string::String,
72}
73///Deterministic font request: explicit ID wins, otherwise aliases are matched.
74///
75/// <details><summary>JSON schema</summary>
76///
77/// ```json
78///{
79///  "description": "Deterministic font request: explicit ID wins, otherwise aliases are matched.",
80///  "type": "object",
81///  "required": [
82///    "aliases"
83///  ],
84///  "properties": {
85///    "aliases": {
86///      "type": "array",
87///      "items": {
88///        "type": "string"
89///      }
90///    },
91///    "font_id": {
92///      "$ref": "#/$defs/StableTextId"
93///    }
94///  },
95///  "additionalProperties": false
96///}
97/// ```
98/// </details>
99#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
100#[serde(deny_unknown_fields)]
101pub struct FontSelection {
102    pub aliases: ::std::vec::Vec<::std::string::String>,
103    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
104    pub font_id: ::std::option::Option<crate::StableTextId>,
105}