kicad_monkey_contracts/generated/
schematic_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)]
62#[serde(deny_unknown_fields)]
63pub struct Diagnostic {
64 pub code: ::std::string::String,
65 pub message: ::std::string::String,
66 pub phase: DiagnosticPhase,
67 #[serde(
68 default,
69 deserialize_with = "crate::deserialize_present_nonnull",
70 skip_serializing_if = "::std::option::Option::is_none"
71 )]
72 pub position: ::std::option::Option<SourcePosition>,
73 #[serde(
74 default,
75 deserialize_with = "crate::deserialize_present_nonnull",
76 skip_serializing_if = "::std::option::Option::is_none"
77 )]
78 pub token: ::std::option::Option<::std::string::String>,
79}
80#[derive(
96 ::serde::Deserialize,
97 ::serde::Serialize,
98 Clone,
99 Copy,
100 Debug,
101 Eq,
102 Hash,
103 Ord,
104 PartialEq,
105 PartialOrd,
106)]
107pub enum DiagnosticPhase {
108 #[serde(rename = "lex")]
109 Lex,
110 #[serde(rename = "tree")]
111 Tree,
112 #[serde(rename = "build")]
113 Build,
114}
115impl ::std::fmt::Display for DiagnosticPhase {
116 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
117 match *self {
118 Self::Lex => f.write_str("lex"),
119 Self::Tree => f.write_str("tree"),
120 Self::Build => f.write_str("build"),
121 }
122 }
123}
124impl ::std::str::FromStr for DiagnosticPhase {
125 type Err = self::error::ConversionError;
126 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
127 match value {
128 "lex" => Ok(Self::Lex),
129 "tree" => Ok(Self::Tree),
130 "build" => Ok(Self::Build),
131 _ => Err("invalid value".into()),
132 }
133 }
134}
135impl ::std::convert::TryFrom<&str> for DiagnosticPhase {
136 type Error = self::error::ConversionError;
137 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
138 value.parse()
139 }
140}
141impl ::std::convert::TryFrom<&::std::string::String> for DiagnosticPhase {
142 type Error = self::error::ConversionError;
143 fn try_from(
144 value: &::std::string::String,
145 ) -> ::std::result::Result<Self, self::error::ConversionError> {
146 value.parse()
147 }
148}
149impl ::std::convert::TryFrom<::std::string::String> for DiagnosticPhase {
150 type Error = self::error::ConversionError;
151 fn try_from(
152 value: ::std::string::String,
153 ) -> ::std::result::Result<Self, self::error::ConversionError> {
154 value.parse()
155 }
156}
157#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
203#[serde(deny_unknown_fields)]
204pub struct SchematicPlotResultA0 {
205 pub diagnostics: ::std::vec::Vec<Diagnostic>,
206 pub output_bytes: ::std::string::String,
207 pub total_operations: u32,
208 #[serde(rename = "type")]
209 pub type_: ::std::string::String,
210 pub version: ::std::string::String,
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}