kicad_monkey_contracts/generated/
board_plot_result.rs1pub mod error {
3 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#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
73#[serde(deny_unknown_fields)]
74pub struct BoardPlotResultA0 {
75 pub diagnostics: ::std::vec::Vec<Diagnostic>,
76 pub output_bytes: ::std::string::String,
77 pub total_operations: u32,
78 #[serde(rename = "type")]
79 pub type_: ::std::string::String,
80 pub version: ::std::string::String,
81}
82#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
117#[serde(deny_unknown_fields)]
118pub struct Diagnostic {
119 pub code: ::std::string::String,
120 pub message: ::std::string::String,
121 pub phase: DiagnosticPhase,
122 #[serde(
123 default,
124 deserialize_with = "crate::deserialize_present_nonnull",
125 skip_serializing_if = "::std::option::Option::is_none"
126 )]
127 pub position: ::std::option::Option<SourcePosition>,
128 #[serde(
129 default,
130 deserialize_with = "crate::deserialize_present_nonnull",
131 skip_serializing_if = "::std::option::Option::is_none"
132 )]
133 pub token: ::std::option::Option<::std::string::String>,
134}
135#[derive(
151 ::serde::Deserialize,
152 ::serde::Serialize,
153 Clone,
154 Copy,
155 Debug,
156 Eq,
157 Hash,
158 Ord,
159 PartialEq,
160 PartialOrd,
161)]
162pub enum DiagnosticPhase {
163 #[serde(rename = "lex")]
164 Lex,
165 #[serde(rename = "tree")]
166 Tree,
167 #[serde(rename = "build")]
168 Build,
169}
170impl ::std::fmt::Display for DiagnosticPhase {
171 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
172 match *self {
173 Self::Lex => f.write_str("lex"),
174 Self::Tree => f.write_str("tree"),
175 Self::Build => f.write_str("build"),
176 }
177 }
178}
179impl ::std::str::FromStr for DiagnosticPhase {
180 type Err = self::error::ConversionError;
181 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
182 match value {
183 "lex" => Ok(Self::Lex),
184 "tree" => Ok(Self::Tree),
185 "build" => Ok(Self::Build),
186 _ => Err("invalid value".into()),
187 }
188 }
189}
190impl ::std::convert::TryFrom<&str> for DiagnosticPhase {
191 type Error = self::error::ConversionError;
192 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
193 value.parse()
194 }
195}
196impl ::std::convert::TryFrom<&::std::string::String> for DiagnosticPhase {
197 type Error = self::error::ConversionError;
198 fn try_from(
199 value: &::std::string::String,
200 ) -> ::std::result::Result<Self, self::error::ConversionError> {
201 value.parse()
202 }
203}
204impl ::std::convert::TryFrom<::std::string::String> for DiagnosticPhase {
205 type Error = self::error::ConversionError;
206 fn try_from(
207 value: ::std::string::String,
208 ) -> ::std::result::Result<Self, self::error::ConversionError> {
209 value.parse()
210 }
211}
212#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
241#[serde(deny_unknown_fields)]
242pub struct SourcePosition {
243 pub column: ::std::string::String,
244 pub line: ::std::string::String,
245 pub offset: ::std::string::String,
246}