kicad_monkey_contracts/generated/
source_bundle_manifest.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(
39 ::serde::Deserialize, ::serde::Serialize, Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd,
40)]
41#[serde(transparent)]
42pub struct CanonicalUint64Decimal(pub ::std::string::String);
43impl ::std::ops::Deref for CanonicalUint64Decimal {
44 type Target = ::std::string::String;
45 fn deref(&self) -> &::std::string::String {
46 &self.0
47 }
48}
49impl ::std::convert::From<CanonicalUint64Decimal> for ::std::string::String {
50 fn from(value: CanonicalUint64Decimal) -> Self {
51 value.0
52 }
53}
54impl ::std::convert::From<::std::string::String> for CanonicalUint64Decimal {
55 fn from(value: ::std::string::String) -> Self {
56 Self(value)
57 }
58}
59impl ::std::str::FromStr for CanonicalUint64Decimal {
60 type Err = ::std::convert::Infallible;
61 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
62 Ok(Self(value.to_string()))
63 }
64}
65impl ::std::fmt::Display for CanonicalUint64Decimal {
66 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
67 self.0.fmt(f)
68 }
69}
70#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
118#[serde(deny_unknown_fields)]
119pub struct SourceBundleManifestA0 {
120 #[serde(
121 default,
122 deserialize_with = "crate::deserialize_present_nonnull",
123 skip_serializing_if = "::std::option::Option::is_none"
124 )]
125 pub project_path: ::std::option::Option<::std::string::String>,
126 pub root_schematic_path: ::std::string::String,
127 pub schema: ::std::string::String,
128 pub sources: ::std::vec::Vec<SourceBundleSource>,
129 #[serde(rename = "type")]
130 pub type_: ::std::string::String,
131 pub version: ::std::string::String,
132}
133#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
166#[serde(deny_unknown_fields)]
167pub struct SourceBundleSource {
168 pub kind: SourceKind,
169 pub path: ::std::string::String,
170 pub slot: SourceSlot,
171 pub source_bytes: CanonicalUint64Decimal,
172}
173#[derive(
193 ::serde::Deserialize,
194 ::serde::Serialize,
195 Clone,
196 Copy,
197 Debug,
198 Eq,
199 Hash,
200 Ord,
201 PartialEq,
202 PartialOrd,
203)]
204pub enum SourceKind {
205 #[serde(rename = "project")]
206 Project,
207 #[serde(rename = "schematic")]
208 Schematic,
209 #[serde(rename = "symbol_library")]
210 SymbolLibrary,
211 #[serde(rename = "symbol_table")]
212 SymbolTable,
213 #[serde(rename = "worksheet")]
214 Worksheet,
215 #[serde(rename = "other")]
216 Other,
217}
218impl ::std::fmt::Display for SourceKind {
219 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
220 match *self {
221 Self::Project => f.write_str("project"),
222 Self::Schematic => f.write_str("schematic"),
223 Self::SymbolLibrary => f.write_str("symbol_library"),
224 Self::SymbolTable => f.write_str("symbol_table"),
225 Self::Worksheet => f.write_str("worksheet"),
226 Self::Other => f.write_str("other"),
227 }
228 }
229}
230impl ::std::str::FromStr for SourceKind {
231 type Err = self::error::ConversionError;
232 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
233 match value {
234 "project" => Ok(Self::Project),
235 "schematic" => Ok(Self::Schematic),
236 "symbol_library" => Ok(Self::SymbolLibrary),
237 "symbol_table" => Ok(Self::SymbolTable),
238 "worksheet" => Ok(Self::Worksheet),
239 "other" => Ok(Self::Other),
240 _ => Err("invalid value".into()),
241 }
242 }
243}
244impl ::std::convert::TryFrom<&str> for SourceKind {
245 type Error = self::error::ConversionError;
246 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
247 value.parse()
248 }
249}
250impl ::std::convert::TryFrom<&::std::string::String> for SourceKind {
251 type Error = self::error::ConversionError;
252 fn try_from(
253 value: &::std::string::String,
254 ) -> ::std::result::Result<Self, self::error::ConversionError> {
255 value.parse()
256 }
257}
258impl ::std::convert::TryFrom<::std::string::String> for SourceKind {
259 type Error = self::error::ConversionError;
260 fn try_from(
261 value: ::std::string::String,
262 ) -> ::std::result::Result<Self, self::error::ConversionError> {
263 value.parse()
264 }
265}
266#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
280#[serde(transparent)]
281pub struct SourceSlot(pub u32);
282impl ::std::ops::Deref for SourceSlot {
283 type Target = u32;
284 fn deref(&self) -> &u32 {
285 &self.0
286 }
287}
288impl ::std::convert::From<SourceSlot> for u32 {
289 fn from(value: SourceSlot) -> Self {
290 value.0
291 }
292}
293impl ::std::convert::From<u32> for SourceSlot {
294 fn from(value: u32) -> Self {
295 Self(value)
296 }
297}
298impl ::std::str::FromStr for SourceSlot {
299 type Err = <u32 as ::std::str::FromStr>::Err;
300 fn from_str(value: &str) -> ::std::result::Result<Self, Self::Err> {
301 Ok(Self(value.parse()?))
302 }
303}
304impl ::std::convert::TryFrom<&str> for SourceSlot {
305 type Error = <u32 as ::std::str::FromStr>::Err;
306 fn try_from(value: &str) -> ::std::result::Result<Self, Self::Error> {
307 value.parse()
308 }
309}
310impl ::std::convert::TryFrom<String> for SourceSlot {
311 type Error = <u32 as ::std::str::FromStr>::Err;
312 fn try_from(value: String) -> ::std::result::Result<Self, Self::Error> {
313 value.parse()
314 }
315}
316impl ::std::fmt::Display for SourceSlot {
317 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
318 self.0.fmt(f)
319 }
320}