kicad_monkey_contracts/generated/
symbol_library_edit_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(
42 ::serde::Deserialize,
43 ::serde::Serialize,
44 Clone,
45 Copy,
46 Debug,
47 Eq,
48 Hash,
49 Ord,
50 PartialEq,
51 PartialOrd,
52)]
53pub enum SymbolBooleanField {
54 #[serde(rename = "in_bom")]
55 InBom,
56 #[serde(rename = "on_board")]
57 OnBoard,
58}
59impl ::std::fmt::Display for SymbolBooleanField {
60 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
61 match *self {
62 Self::InBom => f.write_str("in_bom"),
63 Self::OnBoard => f.write_str("on_board"),
64 }
65 }
66}
67impl ::std::str::FromStr for SymbolBooleanField {
68 type Err = self::error::ConversionError;
69 fn from_str(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
70 match value {
71 "in_bom" => Ok(Self::InBom),
72 "on_board" => Ok(Self::OnBoard),
73 _ => Err("invalid value".into()),
74 }
75 }
76}
77impl ::std::convert::TryFrom<&str> for SymbolBooleanField {
78 type Error = self::error::ConversionError;
79 fn try_from(value: &str) -> ::std::result::Result<Self, self::error::ConversionError> {
80 value.parse()
81 }
82}
83impl ::std::convert::TryFrom<&::std::string::String> for SymbolBooleanField {
84 type Error = self::error::ConversionError;
85 fn try_from(
86 value: &::std::string::String,
87 ) -> ::std::result::Result<Self, self::error::ConversionError> {
88 value.parse()
89 }
90}
91impl ::std::convert::TryFrom<::std::string::String> for SymbolBooleanField {
92 type Error = self::error::ConversionError;
93 fn try_from(
94 value: ::std::string::String,
95 ) -> ::std::result::Result<Self, self::error::ConversionError> {
96 value.parse()
97 }
98}
99#[derive(::serde::Deserialize, ::serde::Serialize, Clone, Debug)]
140#[serde(deny_unknown_fields)]
141pub struct SymbolLibraryEditRequestA0 {
142 pub field: SymbolBooleanField,
143 pub symbol_name: ::std::string::String,
144 #[serde(rename = "type")]
145 pub type_: ::std::string::String,
146 pub value: bool,
147 pub version: ::std::string::String,
148}