kicad_monkey_contracts/generated/
schematic_plot_request.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)]
96#[serde(deny_unknown_fields)]
97pub struct SchematicPlotRequestA0 {
98 pub default_line_width_nm: crate::SchematicDefaultLineWidthNm,
99 #[serde(
100 default,
101 deserialize_with = "crate::deserialize_present_nonnull",
102 skip_serializing_if = "::std::option::Option::is_none"
103 )]
104 pub document_id: ::std::option::Option<::std::string::String>,
105 pub sheet_count: ::std::num::NonZeroU32,
106 pub sheet_index: ::std::num::NonZeroU32,
107 pub sheet_name: ::std::string::String,
108 pub sheet_path: ::std::string::String,
109 #[serde(
110 default,
111 deserialize_with = "crate::deserialize_present_nonnull",
112 skip_serializing_if = "::std::option::Option::is_none"
113 )]
114 pub source_path: ::std::option::Option<::std::string::String>,
115 pub text_offset_ratio: crate::NonNegativeFiniteFloat,
116 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
117 pub text_variables: ::std::vec::Vec<SchematicTextVariable>,
118 #[serde(rename = "type")]
119 pub type_: ::std::string::String,
120 pub version: ::std::string::String,
121 pub worksheet_mode: SchematicWorksheetMode,
122}
123#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
148#[serde(deny_unknown_fields)]
149pub struct SchematicTextVariable {
150 pub name: ::std::string::String,
151 pub value: ::std::string::String,
152}
153#[derive(
169 ::serde::Deserialize,
170 ::serde::Serialize,
171 Clone,
172 Copy,
173 Debug,
174 Eq,
175 Hash,
176 Ord,
177 PartialEq,
178 PartialOrd,
179)]
180pub enum SchematicWorksheetMode {
181 #[serde(rename = "default")]
182 Default,
183 #[serde(rename = "provided")]
184 Provided,
185}
186impl ::std::fmt::Display for SchematicWorksheetMode {
187 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
188 match *self {
189 Self::Default => f.write_str("default"),
190 Self::Provided => f.write_str("provided"),
191 }
192 }
193}
194impl ::std::str::FromStr for SchematicWorksheetMode {
195 type Err = self::error::ConversionError;
196 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
197 match value {
198 "default" => Ok(Self::Default),
199 "provided" => Ok(Self::Provided),
200 _ => Err("invalid value".into()),
201 }
202 }
203}
204impl ::std::convert::TryFrom<&str> for SchematicWorksheetMode {
205 type Error = self::error::ConversionError;
206 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
207 value.parse()
208 }
209}
210impl ::std::convert::TryFrom<&::std::string::String> for SchematicWorksheetMode {
211 type Error = self::error::ConversionError;
212 fn try_from(
213 value: &::std::string::String,
214 ) -> ::std::result::Result<Self, self::error::ConversionError> {
215 value.parse()
216 }
217}
218impl ::std::convert::TryFrom<::std::string::String> for SchematicWorksheetMode {
219 type Error = self::error::ConversionError;
220 fn try_from(
221 value: ::std::string::String,
222 ) -> ::std::result::Result<Self, self::error::ConversionError> {
223 value.parse()
224 }
225}