havok_classes/generated/
hkpBallSocketChainDataConstraintInfo_.rs

1use super::class_requires::*;
2use super::*;
3/// # C++ Info
4/// - name: `hkpBallSocketChainDataConstraintInfo`
5/// - version: `0`
6/// - signature: `0xc9cbedf2`
7/// - size: ` 32`(x86)/` 32`(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 hkpBallSocketChainDataConstraintInfo {
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: `pivotInA`(ctype: `hkVector4`)
28    /// - offset: `  0`(x86)/`  0`(x86_64)
29    /// - type_size: ` 16`(x86)/` 16`(x86_64)
30    #[cfg_attr(feature = "json_schema", schemars(rename = "pivotInA"))]
31    #[cfg_attr(feature = "serde", serde(rename = "pivotInA"))]
32    pub m_pivotInA: Vector4,
33    /// # C++ Info
34    /// - name: `pivotInB`(ctype: `hkVector4`)
35    /// - offset: ` 16`(x86)/` 16`(x86_64)
36    /// - type_size: ` 16`(x86)/` 16`(x86_64)
37    #[cfg_attr(feature = "json_schema", schemars(rename = "pivotInB"))]
38    #[cfg_attr(feature = "serde", serde(rename = "pivotInB"))]
39    pub m_pivotInB: Vector4,
40}
41const _: () = {
42    use havok_serde as _serde;
43    impl _serde::HavokClass for hkpBallSocketChainDataConstraintInfo {
44        #[inline]
45        fn name(&self) -> &'static str {
46            "hkpBallSocketChainDataConstraintInfo"
47        }
48        #[inline]
49        fn signature(&self) -> _serde::__private::Signature {
50            _serde::__private::Signature::new(0xc9cbedf2)
51        }
52        #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
53        fn deps_indexes(&self) -> Vec<usize> {
54            let mut v = Vec::new();
55            v
56        }
57    }
58    impl _serde::Serialize for hkpBallSocketChainDataConstraintInfo {
59        fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
60        where
61            S: _serde::ser::Serializer,
62        {
63            let class_meta = self
64                .__ptr
65                .map(|name| (name, _serde::__private::Signature::new(0xc9cbedf2)));
66            let mut serializer = __serializer
67                .serialize_struct(
68                    "hkpBallSocketChainDataConstraintInfo",
69                    class_meta,
70                    (32u64, 32u64),
71                )?;
72            serializer.serialize_field("pivotInA", &self.m_pivotInA)?;
73            serializer.serialize_field("pivotInB", &self.m_pivotInB)?;
74            serializer.end()
75        }
76    }
77};
78#[doc(hidden)]
79#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
80const _: () = {
81    use havok_serde as _serde;
82    #[automatically_derived]
83    impl<'de> _serde::Deserialize<'de> for hkpBallSocketChainDataConstraintInfo {
84        fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
85        where
86            __D: _serde::Deserializer<'de>,
87        {
88            #[allow(non_camel_case_types)]
89            enum __Field {
90                m_pivotInA,
91                m_pivotInB,
92                __ignore,
93            }
94            struct __FieldVisitor;
95            impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
96                type Value = __Field;
97                fn expecting(
98                    &self,
99                    __formatter: &mut core::fmt::Formatter,
100                ) -> core::fmt::Result {
101                    core::fmt::Formatter::write_str(__formatter, "field identifier")
102                }
103                /// Intended for use in XML.
104                #[allow(clippy::match_single_binding)]
105                #[allow(clippy::reversed_empty_ranges)]
106                #[allow(clippy::single_match)]
107                fn visit_key<__E>(
108                    self,
109                    __value: &str,
110                ) -> core::result::Result<Self::Value, __E>
111                where
112                    __E: _serde::de::Error,
113                {
114                    match __value {
115                        "pivotInA" => Ok(__Field::m_pivotInA),
116                        "pivotInB" => Ok(__Field::m_pivotInB),
117                        _ => Ok(__Field::__ignore),
118                    }
119                }
120            }
121            impl<'de> _serde::Deserialize<'de> for __Field {
122                #[inline]
123                fn deserialize<__D>(
124                    __deserializer: __D,
125                ) -> core::result::Result<Self, __D::Error>
126                where
127                    __D: _serde::Deserializer<'de>,
128                {
129                    _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
130                }
131            }
132            struct __hkpBallSocketChainDataConstraintInfoVisitor<'de> {
133                marker: _serde::__private::PhantomData<
134                    hkpBallSocketChainDataConstraintInfo,
135                >,
136                lifetime: _serde::__private::PhantomData<&'de ()>,
137            }
138            #[allow(clippy::match_single_binding)]
139            #[allow(clippy::reversed_empty_ranges)]
140            #[allow(clippy::single_match)]
141            impl<'de> _serde::de::Visitor<'de>
142            for __hkpBallSocketChainDataConstraintInfoVisitor<'de> {
143                type Value = hkpBallSocketChainDataConstraintInfo;
144                fn expecting(
145                    &self,
146                    __formatter: &mut core::fmt::Formatter,
147                ) -> core::fmt::Result {
148                    core::fmt::Formatter::write_str(
149                        __formatter,
150                        "struct hkpBallSocketChainDataConstraintInfo",
151                    )
152                }
153                fn visit_struct_for_bytes<__A>(
154                    self,
155                    mut __map: __A,
156                ) -> _serde::__private::Result<Self::Value, __A::Error>
157                where
158                    __A: _serde::de::MapAccess<'de>,
159                {
160                    let __ptr = __A::class_ptr(&mut __map);
161                    let mut m_pivotInA: _serde::__private::Option<Vector4> = _serde::__private::None;
162                    let mut m_pivotInB: _serde::__private::Option<Vector4> = _serde::__private::None;
163                    for i in 0..2usize {
164                        match i {
165                            0usize => {
166                                if _serde::__private::Option::is_some(&m_pivotInA) {
167                                    return _serde::__private::Err(
168                                        <__A::Error as _serde::de::Error>::duplicate_field(
169                                            "pivotInA",
170                                        ),
171                                    );
172                                }
173                                m_pivotInA = _serde::__private::Some(
174                                    match __A::next_value::<Vector4>(&mut __map) {
175                                        _serde::__private::Ok(__val) => __val,
176                                        _serde::__private::Err(__err) => {
177                                            return _serde::__private::Err(__err);
178                                        }
179                                    },
180                                );
181                            }
182                            1usize => {
183                                if _serde::__private::Option::is_some(&m_pivotInB) {
184                                    return _serde::__private::Err(
185                                        <__A::Error as _serde::de::Error>::duplicate_field(
186                                            "pivotInB",
187                                        ),
188                                    );
189                                }
190                                m_pivotInB = _serde::__private::Some(
191                                    match __A::next_value::<Vector4>(&mut __map) {
192                                        _serde::__private::Ok(__val) => __val,
193                                        _serde::__private::Err(__err) => {
194                                            return _serde::__private::Err(__err);
195                                        }
196                                    },
197                                );
198                            }
199                            _ => {}
200                        }
201                    }
202                    let m_pivotInA = match m_pivotInA {
203                        _serde::__private::Some(__field) => __field,
204                        _serde::__private::None => {
205                            return _serde::__private::Err(
206                                <__A::Error as _serde::de::Error>::missing_field("pivotInA"),
207                            );
208                        }
209                    };
210                    let m_pivotInB = match m_pivotInB {
211                        _serde::__private::Some(__field) => __field,
212                        _serde::__private::None => {
213                            return _serde::__private::Err(
214                                <__A::Error as _serde::de::Error>::missing_field("pivotInB"),
215                            );
216                        }
217                    };
218                    _serde::__private::Ok(hkpBallSocketChainDataConstraintInfo {
219                        __ptr,
220                        m_pivotInA,
221                        m_pivotInB,
222                    })
223                }
224                #[allow(clippy::manual_unwrap_or_default)]
225                fn visit_struct<__A>(
226                    self,
227                    mut __map: __A,
228                ) -> _serde::__private::Result<Self::Value, __A::Error>
229                where
230                    __A: _serde::de::MapAccess<'de>,
231                {
232                    let mut m_pivotInA: _serde::__private::Option<Vector4> = _serde::__private::None;
233                    let mut m_pivotInB: _serde::__private::Option<Vector4> = _serde::__private::None;
234                    while let _serde::__private::Some(__key) = {
235                        __A::next_key::<__Field>(&mut __map)?
236                    } {
237                        match __key {
238                            __Field::m_pivotInA => {
239                                #[cfg(
240                                    any(feature = "strict", feature = "ignore_duplicates")
241                                )]
242                                if _serde::__private::Option::is_some(&m_pivotInA) {
243                                    #[cfg(feature = "ignore_duplicates")]
244                                    {
245                                        __A::skip_value(&mut __map)?;
246                                        continue;
247                                    }
248                                    #[cfg(feature = "strict")]
249                                    return _serde::__private::Err(
250                                        <__A::Error as _serde::de::Error>::duplicate_field(
251                                            "pivotInA",
252                                        ),
253                                    );
254                                }
255                                m_pivotInA = _serde::__private::Some(
256                                    match __A::next_value::<Vector4>(&mut __map) {
257                                        _serde::__private::Ok(__val) => __val,
258                                        _serde::__private::Err(__err) => {
259                                            return _serde::__private::Err(__err);
260                                        }
261                                    },
262                                );
263                            }
264                            __Field::m_pivotInB => {
265                                #[cfg(
266                                    any(feature = "strict", feature = "ignore_duplicates")
267                                )]
268                                if _serde::__private::Option::is_some(&m_pivotInB) {
269                                    #[cfg(feature = "ignore_duplicates")]
270                                    {
271                                        __A::skip_value(&mut __map)?;
272                                        continue;
273                                    }
274                                    #[cfg(feature = "strict")]
275                                    return _serde::__private::Err(
276                                        <__A::Error as _serde::de::Error>::duplicate_field(
277                                            "pivotInB",
278                                        ),
279                                    );
280                                }
281                                m_pivotInB = _serde::__private::Some(
282                                    match __A::next_value::<Vector4>(&mut __map) {
283                                        _serde::__private::Ok(__val) => __val,
284                                        _serde::__private::Err(__err) => {
285                                            return _serde::__private::Err(__err);
286                                        }
287                                    },
288                                );
289                            }
290                            _ => __A::skip_value(&mut __map)?,
291                        }
292                    }
293                    let m_pivotInA = match m_pivotInA {
294                        _serde::__private::Some(__field) => __field,
295                        _serde::__private::None => {
296                            #[cfg(feature = "strict")]
297                            return _serde::__private::Err(
298                                <__A::Error as _serde::de::Error>::missing_field("pivotInA"),
299                            );
300                            #[cfg(not(feature = "strict"))] Default::default()
301                        }
302                    };
303                    let m_pivotInB = match m_pivotInB {
304                        _serde::__private::Some(__field) => __field,
305                        _serde::__private::None => {
306                            #[cfg(feature = "strict")]
307                            return _serde::__private::Err(
308                                <__A::Error as _serde::de::Error>::missing_field("pivotInB"),
309                            );
310                            #[cfg(not(feature = "strict"))] Default::default()
311                        }
312                    };
313                    let __ptr = __A::class_ptr(&mut __map);
314                    _serde::__private::Ok(hkpBallSocketChainDataConstraintInfo {
315                        __ptr,
316                        m_pivotInA,
317                        m_pivotInB,
318                    })
319                }
320            }
321            const FIELDS: &[&str] = &["pivotInA", "pivotInB"];
322            _serde::Deserializer::deserialize_struct(
323                deserializer,
324                "hkpBallSocketChainDataConstraintInfo",
325                FIELDS,
326                __hkpBallSocketChainDataConstraintInfoVisitor {
327                    marker: _serde::__private::PhantomData::<
328                        hkpBallSocketChainDataConstraintInfo,
329                    >,
330                    lifetime: _serde::__private::PhantomData,
331                },
332            )
333        }
334    }
335};