havok_classes/generated/
hkbFootIkControlData_.rs

1use super::class_requires::*;
2use super::*;
3/// # C++ Info
4/// - name: `hkbFootIkControlData`
5/// - version: `0`
6/// - signature: `0xa111b704`
7/// - size: ` 48`(x86)/` 48`(x86_64)
8/// -  vtable: `false`
9#[allow(non_upper_case_globals, non_snake_case)]
10#[cfg_attr(feature = "json_schema", derive(schemars::JsonSchema))]
11#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
12#[derive(educe::Educe)]
13#[educe(Debug, Clone, Default, PartialEq)]
14pub struct hkbFootIkControlData {
15    /// # Unique index for this class
16    /// - Represents a pointer on XML (`<hkobject name="#0001"></hkobject>`)
17    /// - [`Option::None`] => This class is `class in field`.(`<hkobject></hkobject>`)
18    ///
19    /// # Note
20    /// Not present in the binary & Not exist actual C++ field.
21    #[cfg_attr(
22        feature = "serde",
23        serde(skip_serializing_if = "Option::is_none", default)
24    )]
25    pub __ptr: Option<Pointer>,
26    /// # C++ Info
27    /// - name: `gains`(ctype: `struct hkbFootIkGains`)
28    /// - offset: `  0`(x86)/`  0`(x86_64)
29    /// - type_size: ` 48`(x86)/` 48`(x86_64)
30    /// - flags: `ALIGN_16`
31    #[cfg_attr(feature = "json_schema", schemars(rename = "gains"))]
32    #[cfg_attr(feature = "serde", serde(rename = "gains"))]
33    pub m_gains: hkbFootIkGains,
34}
35const _: () = {
36    use havok_serde as _serde;
37    impl _serde::HavokClass for hkbFootIkControlData {
38        #[inline]
39        fn name(&self) -> &'static str {
40            "hkbFootIkControlData"
41        }
42        #[inline]
43        fn signature(&self) -> _serde::__private::Signature {
44            _serde::__private::Signature::new(0xa111b704)
45        }
46        #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
47        fn deps_indexes(&self) -> Vec<usize> {
48            let mut v = Vec::new();
49            v.extend(self.m_gains.deps_indexes());
50            v
51        }
52    }
53    impl _serde::Serialize for hkbFootIkControlData {
54        fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
55        where
56            S: _serde::ser::Serializer,
57        {
58            let class_meta = self
59                .__ptr
60                .map(|name| (name, _serde::__private::Signature::new(0xa111b704)));
61            let mut serializer = __serializer
62                .serialize_struct("hkbFootIkControlData", class_meta, (48u64, 48u64))?;
63            serializer.serialize_field("gains", &self.m_gains)?;
64            serializer.end()
65        }
66    }
67};
68#[doc(hidden)]
69#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
70const _: () = {
71    use havok_serde as _serde;
72    #[automatically_derived]
73    impl<'de> _serde::Deserialize<'de> for hkbFootIkControlData {
74        fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
75        where
76            __D: _serde::Deserializer<'de>,
77        {
78            #[allow(non_camel_case_types)]
79            enum __Field {
80                m_gains,
81                __ignore,
82            }
83            struct __FieldVisitor;
84            impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
85                type Value = __Field;
86                fn expecting(
87                    &self,
88                    __formatter: &mut core::fmt::Formatter,
89                ) -> core::fmt::Result {
90                    core::fmt::Formatter::write_str(__formatter, "field identifier")
91                }
92                /// Intended for use in XML.
93                #[allow(clippy::match_single_binding)]
94                #[allow(clippy::reversed_empty_ranges)]
95                #[allow(clippy::single_match)]
96                fn visit_key<__E>(
97                    self,
98                    __value: &str,
99                ) -> core::result::Result<Self::Value, __E>
100                where
101                    __E: _serde::de::Error,
102                {
103                    match __value {
104                        "gains" => Ok(__Field::m_gains),
105                        _ => Ok(__Field::__ignore),
106                    }
107                }
108            }
109            impl<'de> _serde::Deserialize<'de> for __Field {
110                #[inline]
111                fn deserialize<__D>(
112                    __deserializer: __D,
113                ) -> core::result::Result<Self, __D::Error>
114                where
115                    __D: _serde::Deserializer<'de>,
116                {
117                    _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
118                }
119            }
120            struct __hkbFootIkControlDataVisitor<'de> {
121                marker: _serde::__private::PhantomData<hkbFootIkControlData>,
122                lifetime: _serde::__private::PhantomData<&'de ()>,
123            }
124            #[allow(clippy::match_single_binding)]
125            #[allow(clippy::reversed_empty_ranges)]
126            #[allow(clippy::single_match)]
127            impl<'de> _serde::de::Visitor<'de> for __hkbFootIkControlDataVisitor<'de> {
128                type Value = hkbFootIkControlData;
129                fn expecting(
130                    &self,
131                    __formatter: &mut core::fmt::Formatter,
132                ) -> core::fmt::Result {
133                    core::fmt::Formatter::write_str(
134                        __formatter,
135                        "struct hkbFootIkControlData",
136                    )
137                }
138                fn visit_struct_for_bytes<__A>(
139                    self,
140                    mut __map: __A,
141                ) -> _serde::__private::Result<Self::Value, __A::Error>
142                where
143                    __A: _serde::de::MapAccess<'de>,
144                {
145                    let __ptr = __A::class_ptr(&mut __map);
146                    let mut m_gains: _serde::__private::Option<hkbFootIkGains> = _serde::__private::None;
147                    for i in 0..1usize {
148                        match i {
149                            0usize => {
150                                if _serde::__private::Option::is_some(&m_gains) {
151                                    return _serde::__private::Err(
152                                        <__A::Error as _serde::de::Error>::duplicate_field("gains"),
153                                    );
154                                }
155                                m_gains = _serde::__private::Some(
156                                    match __A::next_value::<hkbFootIkGains>(&mut __map) {
157                                        _serde::__private::Ok(__val) => __val,
158                                        _serde::__private::Err(__err) => {
159                                            return _serde::__private::Err(__err);
160                                        }
161                                    },
162                                );
163                            }
164                            _ => {}
165                        }
166                    }
167                    let m_gains = match m_gains {
168                        _serde::__private::Some(__field) => __field,
169                        _serde::__private::None => {
170                            return _serde::__private::Err(
171                                <__A::Error as _serde::de::Error>::missing_field("gains"),
172                            );
173                        }
174                    };
175                    _serde::__private::Ok(hkbFootIkControlData {
176                        __ptr,
177                        m_gains,
178                    })
179                }
180                #[allow(clippy::manual_unwrap_or_default)]
181                fn visit_struct<__A>(
182                    self,
183                    mut __map: __A,
184                ) -> _serde::__private::Result<Self::Value, __A::Error>
185                where
186                    __A: _serde::de::MapAccess<'de>,
187                {
188                    let mut m_gains: _serde::__private::Option<hkbFootIkGains> = _serde::__private::None;
189                    while let _serde::__private::Some(__key) = {
190                        __A::next_key::<__Field>(&mut __map)?
191                    } {
192                        match __key {
193                            __Field::m_gains => {
194                                #[cfg(
195                                    any(feature = "strict", feature = "ignore_duplicates")
196                                )]
197                                if _serde::__private::Option::is_some(&m_gains) {
198                                    #[cfg(feature = "ignore_duplicates")]
199                                    {
200                                        __A::skip_value(&mut __map)?;
201                                        continue;
202                                    }
203                                    #[cfg(feature = "strict")]
204                                    return _serde::__private::Err(
205                                        <__A::Error as _serde::de::Error>::duplicate_field("gains"),
206                                    );
207                                }
208                                m_gains = _serde::__private::Some(
209                                    match __A::next_value::<hkbFootIkGains>(&mut __map) {
210                                        _serde::__private::Ok(__val) => __val,
211                                        _serde::__private::Err(__err) => {
212                                            return _serde::__private::Err(__err);
213                                        }
214                                    },
215                                );
216                            }
217                            _ => __A::skip_value(&mut __map)?,
218                        }
219                    }
220                    let m_gains = match m_gains {
221                        _serde::__private::Some(__field) => __field,
222                        _serde::__private::None => {
223                            #[cfg(feature = "strict")]
224                            return _serde::__private::Err(
225                                <__A::Error as _serde::de::Error>::missing_field("gains"),
226                            );
227                            #[cfg(not(feature = "strict"))] Default::default()
228                        }
229                    };
230                    let __ptr = __A::class_ptr(&mut __map);
231                    _serde::__private::Ok(hkbFootIkControlData {
232                        __ptr,
233                        m_gains,
234                    })
235                }
236            }
237            const FIELDS: &[&str] = &["gains"];
238            _serde::Deserializer::deserialize_struct(
239                deserializer,
240                "hkbFootIkControlData",
241                FIELDS,
242                __hkbFootIkControlDataVisitor {
243                    marker: _serde::__private::PhantomData::<hkbFootIkControlData>,
244                    lifetime: _serde::__private::PhantomData,
245                },
246            )
247        }
248    }
249};