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

kicad_monkey_contracts/generated/
scan_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///Metadata envelope for a byte-buffer structural scan operation.
28///
29/// <details><summary>JSON schema</summary>
30///
31/// ```json
32///{
33///  "$id": "urn:wavenumber:schema:kicad_monkey.sexpr_scan.request:a0",
34///  "title": "S-expression scan request a0",
35///  "description": "Metadata envelope for a byte-buffer structural scan operation.",
36///  "type": "object",
37///  "required": [
38///    "selector",
39///    "type",
40///    "version"
41///  ],
42///  "properties": {
43///    "selector": {
44///      "$ref": "#/$defs/Selector"
45///    },
46///    "type": {
47///      "type": "string",
48///      "const": "kicad_monkey.sexpr_scan.request"
49///    },
50///    "version": {
51///      "type": "string",
52///      "const": "a0"
53///    }
54///  },
55///  "additionalProperties": false
56///}
57/// ```
58/// </details>
59#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
60#[serde(deny_unknown_fields)]
61pub struct SExpressionScanRequestA0 {
62    pub selector: Selector,
63    #[serde(rename = "type")]
64    pub type_: ::std::string::String,
65    pub version: ::std::string::String,
66}
67///Generic structural selector; source bytes are always supplied out of band.
68///
69/// <details><summary>JSON schema</summary>
70///
71/// ```json
72///{
73///  "description": "Generic structural selector; source bytes are always supplied out of band.",
74///  "type": "object",
75///  "properties": {
76///    "heads": {
77///      "type": "array",
78///      "items": {
79///        "type": "string"
80///      }
81///    },
82///    "max_depth": {
83///      "type": "integer",
84///      "maximum": 4294967295.0,
85///      "minimum": 0.0
86///    },
87///    "min_depth": {
88///      "type": "integer",
89///      "maximum": 4294967295.0,
90///      "minimum": 0.0
91///    },
92///    "paths": {
93///      "type": "array",
94///      "items": {
95///        "type": "array",
96///        "items": {
97///          "type": "string"
98///        }
99///      }
100///    },
101///    "prune_heads": {
102///      "type": "array",
103///      "items": {
104///        "type": "string"
105///      }
106///    }
107///  },
108///  "additionalProperties": false
109///}
110/// ```
111/// </details>
112#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
113#[serde(deny_unknown_fields)]
114pub struct Selector {
115    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
116    pub heads: ::std::vec::Vec<::std::string::String>,
117    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
118    pub max_depth: ::std::option::Option<u32>,
119    #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
120    pub min_depth: ::std::option::Option<u32>,
121    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
122    pub paths: ::std::vec::Vec<::std::vec::Vec<::std::string::String>>,
123    #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
124    pub prune_heads: ::std::vec::Vec<::std::string::String>,
125}
126impl ::std::default::Default for Selector {
127    fn default() -> Self {
128        Self {
129            heads: Default::default(),
130            max_depth: Default::default(),
131            min_depth: Default::default(),
132            paths: Default::default(),
133            prune_heads: Default::default(),
134        }
135    }
136}