havok_classes/generated/
hkpBallAndSocketConstraintDataAtoms_.rs

1use super::class_requires::*;
2use super::*;
3/// # C++ Info
4/// - name: `hkpBallAndSocketConstraintDataAtoms`
5/// - version: `1`
6/// - signature: `0xc73dcaf9`
7/// - size: ` 80`(x86)/` 80`(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 hkpBallAndSocketConstraintDataAtoms {
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: `pivots`(ctype: `struct hkpSetLocalTranslationsConstraintAtom`)
28    /// - offset: `  0`(x86)/`  0`(x86_64)
29    /// - type_size: ` 48`(x86)/` 48`(x86_64)
30    #[cfg_attr(feature = "json_schema", schemars(rename = "pivots"))]
31    #[cfg_attr(feature = "serde", serde(rename = "pivots"))]
32    pub m_pivots: hkpSetLocalTranslationsConstraintAtom,
33    /// # C++ Info
34    /// - name: `setupStabilization`(ctype: `struct hkpSetupStabilizationAtom`)
35    /// - offset: ` 48`(x86)/` 48`(x86_64)
36    /// - type_size: ` 16`(x86)/` 16`(x86_64)
37    #[cfg_attr(feature = "json_schema", schemars(rename = "setupStabilization"))]
38    #[cfg_attr(feature = "serde", serde(rename = "setupStabilization"))]
39    pub m_setupStabilization: hkpSetupStabilizationAtom,
40    /// # C++ Info
41    /// - name: `ballSocket`(ctype: `struct hkpBallSocketConstraintAtom`)
42    /// - offset: ` 64`(x86)/` 64`(x86_64)
43    /// - type_size: ` 16`(x86)/` 16`(x86_64)
44    #[cfg_attr(feature = "json_schema", schemars(rename = "ballSocket"))]
45    #[cfg_attr(feature = "serde", serde(rename = "ballSocket"))]
46    pub m_ballSocket: hkpBallSocketConstraintAtom,
47}
48const _: () = {
49    use havok_serde as _serde;
50    impl _serde::HavokClass for hkpBallAndSocketConstraintDataAtoms {
51        #[inline]
52        fn name(&self) -> &'static str {
53            "hkpBallAndSocketConstraintDataAtoms"
54        }
55        #[inline]
56        fn signature(&self) -> _serde::__private::Signature {
57            _serde::__private::Signature::new(0xc73dcaf9)
58        }
59        #[allow(clippy::let_and_return, clippy::vec_init_then_push)]
60        fn deps_indexes(&self) -> Vec<usize> {
61            let mut v = Vec::new();
62            v.extend(self.m_pivots.deps_indexes());
63            v.extend(self.m_setupStabilization.deps_indexes());
64            v.extend(self.m_ballSocket.deps_indexes());
65            v
66        }
67    }
68    impl _serde::Serialize for hkpBallAndSocketConstraintDataAtoms {
69        fn serialize<S>(&self, __serializer: S) -> Result<S::Ok, S::Error>
70        where
71            S: _serde::ser::Serializer,
72        {
73            let class_meta = self
74                .__ptr
75                .map(|name| (name, _serde::__private::Signature::new(0xc73dcaf9)));
76            let mut serializer = __serializer
77                .serialize_struct(
78                    "hkpBallAndSocketConstraintDataAtoms",
79                    class_meta,
80                    (80u64, 80u64),
81                )?;
82            serializer.serialize_field("pivots", &self.m_pivots)?;
83            serializer
84                .serialize_field("setupStabilization", &self.m_setupStabilization)?;
85            serializer.serialize_field("ballSocket", &self.m_ballSocket)?;
86            serializer.end()
87        }
88    }
89};
90#[doc(hidden)]
91#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
92const _: () = {
93    use havok_serde as _serde;
94    #[automatically_derived]
95    impl<'de> _serde::Deserialize<'de> for hkpBallAndSocketConstraintDataAtoms {
96        fn deserialize<__D>(deserializer: __D) -> core::result::Result<Self, __D::Error>
97        where
98            __D: _serde::Deserializer<'de>,
99        {
100            #[allow(non_camel_case_types)]
101            enum __Field {
102                m_pivots,
103                m_setupStabilization,
104                m_ballSocket,
105                __ignore,
106            }
107            struct __FieldVisitor;
108            impl<'de> _serde::de::Visitor<'de> for __FieldVisitor {
109                type Value = __Field;
110                fn expecting(
111                    &self,
112                    __formatter: &mut core::fmt::Formatter,
113                ) -> core::fmt::Result {
114                    core::fmt::Formatter::write_str(__formatter, "field identifier")
115                }
116                /// Intended for use in XML.
117                #[allow(clippy::match_single_binding)]
118                #[allow(clippy::reversed_empty_ranges)]
119                #[allow(clippy::single_match)]
120                fn visit_key<__E>(
121                    self,
122                    __value: &str,
123                ) -> core::result::Result<Self::Value, __E>
124                where
125                    __E: _serde::de::Error,
126                {
127                    match __value {
128                        "pivots" => Ok(__Field::m_pivots),
129                        "setupStabilization" => Ok(__Field::m_setupStabilization),
130                        "ballSocket" => Ok(__Field::m_ballSocket),
131                        _ => Ok(__Field::__ignore),
132                    }
133                }
134            }
135            impl<'de> _serde::Deserialize<'de> for __Field {
136                #[inline]
137                fn deserialize<__D>(
138                    __deserializer: __D,
139                ) -> core::result::Result<Self, __D::Error>
140                where
141                    __D: _serde::Deserializer<'de>,
142                {
143                    _serde::Deserializer::deserialize_key(__deserializer, __FieldVisitor)
144                }
145            }
146            struct __hkpBallAndSocketConstraintDataAtomsVisitor<'de> {
147                marker: _serde::__private::PhantomData<
148                    hkpBallAndSocketConstraintDataAtoms,
149                >,
150                lifetime: _serde::__private::PhantomData<&'de ()>,
151            }
152            #[allow(clippy::match_single_binding)]
153            #[allow(clippy::reversed_empty_ranges)]
154            #[allow(clippy::single_match)]
155            impl<'de> _serde::de::Visitor<'de>
156            for __hkpBallAndSocketConstraintDataAtomsVisitor<'de> {
157                type Value = hkpBallAndSocketConstraintDataAtoms;
158                fn expecting(
159                    &self,
160                    __formatter: &mut core::fmt::Formatter,
161                ) -> core::fmt::Result {
162                    core::fmt::Formatter::write_str(
163                        __formatter,
164                        "struct hkpBallAndSocketConstraintDataAtoms",
165                    )
166                }
167                fn visit_struct_for_bytes<__A>(
168                    self,
169                    mut __map: __A,
170                ) -> _serde::__private::Result<Self::Value, __A::Error>
171                where
172                    __A: _serde::de::MapAccess<'de>,
173                {
174                    let __ptr = __A::class_ptr(&mut __map);
175                    let mut m_pivots: _serde::__private::Option<
176                        hkpSetLocalTranslationsConstraintAtom,
177                    > = _serde::__private::None;
178                    let mut m_setupStabilization: _serde::__private::Option<
179                        hkpSetupStabilizationAtom,
180                    > = _serde::__private::None;
181                    let mut m_ballSocket: _serde::__private::Option<
182                        hkpBallSocketConstraintAtom,
183                    > = _serde::__private::None;
184                    for i in 0..3usize {
185                        match i {
186                            0usize => {
187                                if _serde::__private::Option::is_some(&m_pivots) {
188                                    return _serde::__private::Err(
189                                        <__A::Error as _serde::de::Error>::duplicate_field("pivots"),
190                                    );
191                                }
192                                m_pivots = _serde::__private::Some(
193                                    match __A::next_value::<
194                                        hkpSetLocalTranslationsConstraintAtom,
195                                    >(&mut __map) {
196                                        _serde::__private::Ok(__val) => __val,
197                                        _serde::__private::Err(__err) => {
198                                            return _serde::__private::Err(__err);
199                                        }
200                                    },
201                                );
202                            }
203                            1usize => {
204                                if _serde::__private::Option::is_some(
205                                    &m_setupStabilization,
206                                ) {
207                                    return _serde::__private::Err(
208                                        <__A::Error as _serde::de::Error>::duplicate_field(
209                                            "setupStabilization",
210                                        ),
211                                    );
212                                }
213                                m_setupStabilization = _serde::__private::Some(
214                                    match __A::next_value::<
215                                        hkpSetupStabilizationAtom,
216                                    >(&mut __map) {
217                                        _serde::__private::Ok(__val) => __val,
218                                        _serde::__private::Err(__err) => {
219                                            return _serde::__private::Err(__err);
220                                        }
221                                    },
222                                );
223                            }
224                            2usize => {
225                                if _serde::__private::Option::is_some(&m_ballSocket) {
226                                    return _serde::__private::Err(
227                                        <__A::Error as _serde::de::Error>::duplicate_field(
228                                            "ballSocket",
229                                        ),
230                                    );
231                                }
232                                m_ballSocket = _serde::__private::Some(
233                                    match __A::next_value::<
234                                        hkpBallSocketConstraintAtom,
235                                    >(&mut __map) {
236                                        _serde::__private::Ok(__val) => __val,
237                                        _serde::__private::Err(__err) => {
238                                            return _serde::__private::Err(__err);
239                                        }
240                                    },
241                                );
242                            }
243                            _ => {}
244                        }
245                    }
246                    let m_pivots = match m_pivots {
247                        _serde::__private::Some(__field) => __field,
248                        _serde::__private::None => {
249                            return _serde::__private::Err(
250                                <__A::Error as _serde::de::Error>::missing_field("pivots"),
251                            );
252                        }
253                    };
254                    let m_setupStabilization = match m_setupStabilization {
255                        _serde::__private::Some(__field) => __field,
256                        _serde::__private::None => {
257                            return _serde::__private::Err(
258                                <__A::Error as _serde::de::Error>::missing_field(
259                                    "setupStabilization",
260                                ),
261                            );
262                        }
263                    };
264                    let m_ballSocket = match m_ballSocket {
265                        _serde::__private::Some(__field) => __field,
266                        _serde::__private::None => {
267                            return _serde::__private::Err(
268                                <__A::Error as _serde::de::Error>::missing_field(
269                                    "ballSocket",
270                                ),
271                            );
272                        }
273                    };
274                    _serde::__private::Ok(hkpBallAndSocketConstraintDataAtoms {
275                        __ptr,
276                        m_pivots,
277                        m_setupStabilization,
278                        m_ballSocket,
279                    })
280                }
281                #[allow(clippy::manual_unwrap_or_default)]
282                fn visit_struct<__A>(
283                    self,
284                    mut __map: __A,
285                ) -> _serde::__private::Result<Self::Value, __A::Error>
286                where
287                    __A: _serde::de::MapAccess<'de>,
288                {
289                    let mut m_pivots: _serde::__private::Option<
290                        hkpSetLocalTranslationsConstraintAtom,
291                    > = _serde::__private::None;
292                    let mut m_setupStabilization: _serde::__private::Option<
293                        hkpSetupStabilizationAtom,
294                    > = _serde::__private::None;
295                    let mut m_ballSocket: _serde::__private::Option<
296                        hkpBallSocketConstraintAtom,
297                    > = _serde::__private::None;
298                    while let _serde::__private::Some(__key) = {
299                        __A::next_key::<__Field>(&mut __map)?
300                    } {
301                        match __key {
302                            __Field::m_pivots => {
303                                #[cfg(
304                                    any(feature = "strict", feature = "ignore_duplicates")
305                                )]
306                                if _serde::__private::Option::is_some(&m_pivots) {
307                                    #[cfg(feature = "ignore_duplicates")]
308                                    {
309                                        __A::skip_value(&mut __map)?;
310                                        continue;
311                                    }
312                                    #[cfg(feature = "strict")]
313                                    return _serde::__private::Err(
314                                        <__A::Error as _serde::de::Error>::duplicate_field("pivots"),
315                                    );
316                                }
317                                m_pivots = _serde::__private::Some(
318                                    match __A::next_value::<
319                                        hkpSetLocalTranslationsConstraintAtom,
320                                    >(&mut __map) {
321                                        _serde::__private::Ok(__val) => __val,
322                                        _serde::__private::Err(__err) => {
323                                            return _serde::__private::Err(__err);
324                                        }
325                                    },
326                                );
327                            }
328                            __Field::m_setupStabilization => {
329                                #[cfg(
330                                    any(feature = "strict", feature = "ignore_duplicates")
331                                )]
332                                if _serde::__private::Option::is_some(
333                                    &m_setupStabilization,
334                                ) {
335                                    #[cfg(feature = "ignore_duplicates")]
336                                    {
337                                        __A::skip_value(&mut __map)?;
338                                        continue;
339                                    }
340                                    #[cfg(feature = "strict")]
341                                    return _serde::__private::Err(
342                                        <__A::Error as _serde::de::Error>::duplicate_field(
343                                            "setupStabilization",
344                                        ),
345                                    );
346                                }
347                                m_setupStabilization = _serde::__private::Some(
348                                    match __A::next_value::<
349                                        hkpSetupStabilizationAtom,
350                                    >(&mut __map) {
351                                        _serde::__private::Ok(__val) => __val,
352                                        _serde::__private::Err(__err) => {
353                                            return _serde::__private::Err(__err);
354                                        }
355                                    },
356                                );
357                            }
358                            __Field::m_ballSocket => {
359                                #[cfg(
360                                    any(feature = "strict", feature = "ignore_duplicates")
361                                )]
362                                if _serde::__private::Option::is_some(&m_ballSocket) {
363                                    #[cfg(feature = "ignore_duplicates")]
364                                    {
365                                        __A::skip_value(&mut __map)?;
366                                        continue;
367                                    }
368                                    #[cfg(feature = "strict")]
369                                    return _serde::__private::Err(
370                                        <__A::Error as _serde::de::Error>::duplicate_field(
371                                            "ballSocket",
372                                        ),
373                                    );
374                                }
375                                m_ballSocket = _serde::__private::Some(
376                                    match __A::next_value::<
377                                        hkpBallSocketConstraintAtom,
378                                    >(&mut __map) {
379                                        _serde::__private::Ok(__val) => __val,
380                                        _serde::__private::Err(__err) => {
381                                            return _serde::__private::Err(__err);
382                                        }
383                                    },
384                                );
385                            }
386                            _ => __A::skip_value(&mut __map)?,
387                        }
388                    }
389                    let m_pivots = match m_pivots {
390                        _serde::__private::Some(__field) => __field,
391                        _serde::__private::None => {
392                            #[cfg(feature = "strict")]
393                            return _serde::__private::Err(
394                                <__A::Error as _serde::de::Error>::missing_field("pivots"),
395                            );
396                            #[cfg(not(feature = "strict"))] Default::default()
397                        }
398                    };
399                    let m_setupStabilization = match m_setupStabilization {
400                        _serde::__private::Some(__field) => __field,
401                        _serde::__private::None => {
402                            #[cfg(feature = "strict")]
403                            return _serde::__private::Err(
404                                <__A::Error as _serde::de::Error>::missing_field(
405                                    "setupStabilization",
406                                ),
407                            );
408                            #[cfg(not(feature = "strict"))] Default::default()
409                        }
410                    };
411                    let m_ballSocket = match m_ballSocket {
412                        _serde::__private::Some(__field) => __field,
413                        _serde::__private::None => {
414                            #[cfg(feature = "strict")]
415                            return _serde::__private::Err(
416                                <__A::Error as _serde::de::Error>::missing_field(
417                                    "ballSocket",
418                                ),
419                            );
420                            #[cfg(not(feature = "strict"))] Default::default()
421                        }
422                    };
423                    let __ptr = __A::class_ptr(&mut __map);
424                    _serde::__private::Ok(hkpBallAndSocketConstraintDataAtoms {
425                        __ptr,
426                        m_pivots,
427                        m_setupStabilization,
428                        m_ballSocket,
429                    })
430                }
431            }
432            const FIELDS: &[&str] = &["pivots", "setupStabilization", "ballSocket"];
433            _serde::Deserializer::deserialize_struct(
434                deserializer,
435                "hkpBallAndSocketConstraintDataAtoms",
436                FIELDS,
437                __hkpBallAndSocketConstraintDataAtomsVisitor {
438                    marker: _serde::__private::PhantomData::<
439                        hkpBallAndSocketConstraintDataAtoms,
440                    >,
441                    lifetime: _serde::__private::PhantomData,
442                },
443            )
444        }
445    }
446};