kicad_monkey_contracts/generated/
build_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)]
63#[serde(deny_unknown_fields)]
64pub struct Node {
65 #[serde(default, skip_serializing_if = "::std::vec::Vec::is_empty")]
66 pub children: ::std::vec::Vec<Node>,
67 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
68 pub float: ::std::option::Option<f64>,
69 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
70 pub integer: ::std::option::Option<::std::string::String>,
71 pub kind: NodeKind,
72 #[serde(default, skip_serializing_if = "::std::option::Option::is_none")]
73 pub text: ::std::option::Option<::std::string::String>,
74}
75#[derive(
93 ::serde::Deserialize,
94 ::serde::Serialize,
95 Clone,
96 Copy,
97 Debug,
98 Eq,
99 Hash,
100 Ord,
101 PartialEq,
102 PartialOrd,
103)]
104pub enum NodeKind {
105 #[serde(rename = "list")]
106 List,
107 #[serde(rename = "atom")]
108 Atom,
109 #[serde(rename = "quoted")]
110 Quoted,
111 #[serde(rename = "integer")]
112 Integer,
113 #[serde(rename = "float")]
114 Float,
115}
116impl ::std::fmt::Display for NodeKind {
117 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
118 match *self {
119 Self::List => f.write_str("list"),
120 Self::Atom => f.write_str("atom"),
121 Self::Quoted => f.write_str("quoted"),
122 Self::Integer => f.write_str("integer"),
123 Self::Float => f.write_str("float"),
124 }
125 }
126}
127impl ::std::str::FromStr for NodeKind {
128 type Err = self::error::ConversionError;
129 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
130 match value {
131 "list" => Ok(Self::List),
132 "atom" => Ok(Self::Atom),
133 "quoted" => Ok(Self::Quoted),
134 "integer" => Ok(Self::Integer),
135 "float" => Ok(Self::Float),
136 _ => Err("invalid value".into()),
137 }
138 }
139}
140impl ::std::convert::TryFrom<&str> for NodeKind {
141 type Error = self::error::ConversionError;
142 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
143 value.parse()
144 }
145}
146impl ::std::convert::TryFrom<&::std::string::String> for NodeKind {
147 type Error = self::error::ConversionError;
148 fn try_from(
149 value: &::std::string::String,
150 ) -> ::std::result::Result<Self, self::error::ConversionError> {
151 value.parse()
152 }
153}
154impl ::std::convert::TryFrom<::std::string::String> for NodeKind {
155 type Error = self::error::ConversionError;
156 fn try_from(
157 value: ::std::string::String,
158 ) -> ::std::result::Result<Self, self::error::ConversionError> {
159 value.parse()
160 }
161}
162#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
195#[serde(deny_unknown_fields)]
196pub struct SExpressionBuildRequestA0 {
197 pub root: Node,
198 #[serde(rename = "type")]
199 pub type_: ::std::string::String,
200 pub version: ::std::string::String,
201}