Skip to main content

engage/generated/system/
valuetype.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "system-valuetype-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::system::object::{IObject, Object};
9
10    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/valuetype/ValueType.md"))]
11    #[::unity::class(namespace = "System", name = "ValueType")]
12    #[parent(crate::system::object::Object)]
13    pub struct ValueType {}
14}
15
16#[cfg(feature = "system-valuetype-types")]
17pub use __types::*;
18
19#[cfg(feature = "system-valuetype")]
20impl ValueType {
21    #[doc = "`InternalEquals(crate::system::object::Object, crate::system::object::Object, *mut::unity::Array<crate::system::object::Object>)` overload"]
22    pub fn internal_equals(
23        o1: impl ::core::convert::Into<crate::system::object::Object>,
24        o2: impl ::core::convert::Into<crate::system::object::Object>,
25    ) -> (bool, ::unity::Array<crate::system::object::Object>) {
26        unsafe {
27            let mut __out_0 = ::core::mem::MaybeUninit::<::unity::Array<crate::system::object::Object>>::uninit();
28            let __ret = {
29                ::unity::il2cpp_call!((::unity::module_base()+0x33557f0usize)as*mut u8,bool;
30(crate::system::object::Object)::core::convert::Into::into(o1),(crate::system::object::Object)::core::convert::Into::into(o2),(*mut::unity::Array<crate::system::object::Object>)__out_0.as_mut_ptr())
31            };
32            (__ret, __out_0.assume_init())
33        }
34    }
35
36    #[doc = "`DefaultEquals(crate::system::object::Object, crate::system::object::Object)` overload"]
37    pub fn default_equals(
38        o1: impl ::core::convert::Into<crate::system::object::Object>,
39        o2: impl ::core::convert::Into<crate::system::object::Object>,
40    ) -> bool {
41        unsafe {
42            ::unity::il2cpp_call!((::unity::module_base()+0x3355800usize)as*mut u8,bool;
43(crate::system::object::Object)::core::convert::Into::into(o1),(crate::system::object::Object)::core::convert::Into::into(o2))
44        }
45    }
46
47    #[doc = "`InternalGetHashCode(crate::system::object::Object, *mut::unity::Array<crate::system::object::Object>)` overload"]
48    pub fn internal_get_hash_code(
49        o: impl ::core::convert::Into<crate::system::object::Object>,
50    ) -> (i32, ::unity::Array<crate::system::object::Object>) {
51        unsafe {
52            let mut __out_0 = ::core::mem::MaybeUninit::<::unity::Array<crate::system::object::Object>>::uninit();
53            let __ret = {
54                ::unity::il2cpp_call!((::unity::module_base()+0x33559f0usize)as*mut u8,i32;
55(crate::system::object::Object)::core::convert::Into::into(o),(*mut::unity::Array<crate::system::object::Object>)__out_0.as_mut_ptr())
56            };
57            (__ret, __out_0.assume_init())
58        }
59    }
60}
61
62#[cfg(feature = "system-valuetype")]
63pub trait IValueTypeMethods: IValueType {
64    #[doc = "`.ctor()` overload"]
65    fn ctor(self) -> () {
66        unsafe {
67            let __receiver = <ValueType as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
68            ::unity::il2cpp_call!((::unity::module_base()+0x33557e0usize)as*mut u8,();
69(ValueType)__receiver)
70        }
71    }
72    #[doc = "`Equals(crate::system::object::Object)` overload"]
73    fn equals(self, obj: impl ::core::convert::Into<crate::system::object::Object>) -> bool {
74        unsafe {
75            let __receiver = <ValueType as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
76            {
77                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
78                let __vi = *__vt.get(0usize).unwrap_or_else(|| {
79                    panic!(
80                        "unity: virtual slot {}
81 out of range (vtable len {}
82) on the runtime class behind {}
83 (method `{}
84`)",
85                        0usize,
86                        __vt.len(),
87                        <ValueType as ::unity::ClassIdentity>::NAME,
88                        "Equals",
89                    )
90                });
91                let __inner: extern "C" fn(ValueType, crate::system::object::Object, ::unity::OptionalMethod) -> bool =
92                    ::core::mem::transmute(__vi.method_ptr);
93                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
94                __inner(__receiver, ::core::convert::Into::into(obj), __mi)
95            }
96        }
97    }
98    #[doc = "`GetHashCode()` overload"]
99    fn get_hash_code(self) -> i32 {
100        unsafe {
101            let __receiver = <ValueType as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
102            {
103                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
104                let __vi = *__vt.get(2usize).unwrap_or_else(|| {
105                    panic!(
106                        "unity: virtual slot {}
107 out of range (vtable len {}
108) on the runtime class behind {}
109 (method `{}
110`)",
111                        2usize,
112                        __vt.len(),
113                        <ValueType as ::unity::ClassIdentity>::NAME,
114                        "GetHashCode",
115                    )
116                });
117                let __inner: extern "C" fn(ValueType, ::unity::OptionalMethod) -> i32 = ::core::mem::transmute(__vi.method_ptr);
118                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
119                __inner(__receiver, __mi)
120            }
121        }
122    }
123    #[doc = "`ToString()` overload"]
124    fn to_string(self) -> ::unity::Il2CppString {
125        unsafe {
126            let __receiver = <ValueType as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
127            {
128                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
129                let __vi = *__vt.get(3usize).unwrap_or_else(|| {
130                    panic!(
131                        "unity: virtual slot {}
132 out of range (vtable len {}
133) on the runtime class behind {}
134 (method `{}
135`)",
136                        3usize,
137                        __vt.len(),
138                        <ValueType as ::unity::ClassIdentity>::NAME,
139                        "ToString",
140                    )
141                });
142                let __inner: extern "C" fn(ValueType, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__vi.method_ptr);
143                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
144                __inner(__receiver, __mi)
145            }
146        }
147    }
148}
149
150#[cfg(feature = "system-valuetype")]
151impl<__T: IValueType> IValueTypeMethods for __T {}
152
153#[cfg(feature = "system-valuetype")]
154impl ValueType {
155    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
156        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
157    }
158
159    pub fn internal_equals_method_info() -> &'static ::unity::il2cpp::MethodInfo {
160        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
161    }
162
163    pub fn default_equals_method_info() -> &'static ::unity::il2cpp::MethodInfo {
164        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
165    }
166
167    pub fn equals_method_info() -> &'static ::unity::il2cpp::MethodInfo {
168        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
169    }
170
171    pub fn internal_get_hash_code_method_info() -> &'static ::unity::il2cpp::MethodInfo {
172        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
173    }
174
175    pub fn get_hash_code_method_info() -> &'static ::unity::il2cpp::MethodInfo {
176        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
177    }
178
179    pub fn to_string_method_info() -> &'static ::unity::il2cpp::MethodInfo {
180        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
181    }
182}
183
184#[cfg(feature = "system-valuetype")]
185impl ValueType {
186    #[doc = "Direct (non-virtual) call to `ValueType`'s own `Equals`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
187    pub unsafe fn equals(this: impl ::core::convert::Into<::unity::IlInstance>, obj: crate::system::object::Object) -> bool {
188        let __mi = Self::equals_method_info();
189        let __inner: extern "C" fn(::unity::IlInstance, crate::system::object::Object, ::unity::OptionalMethod) -> bool =
190            ::core::mem::transmute(__mi.method_ptr);
191        __inner(this.into(), obj, ::core::option::Option::None)
192    }
193
194    #[doc = "Direct (non-virtual) call to `ValueType`'s own `GetHashCode`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
195    pub unsafe fn get_hash_code(this: impl ::core::convert::Into<::unity::IlInstance>) -> i32 {
196        let __mi = Self::get_hash_code_method_info();
197        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> i32 = ::core::mem::transmute(__mi.method_ptr);
198        __inner(this.into(), ::core::option::Option::None)
199    }
200
201    #[doc = "Direct (non-virtual) call to `ValueType`'s own `ToString`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
202    pub unsafe fn to_string(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
203        let __mi = Self::to_string_method_info();
204        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
205        __inner(this.into(), ::core::option::Option::None)
206    }
207}
208
209#[cfg(feature = "system-valuetype")]
210impl ValueType {
211    #[doc = "`.ctor()` — no args"]
212    pub fn new() -> Self {
213        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
214            panic!(
215                "{}
216::{}
217 failed to instantiate",
218                ::core::stringify!(ValueType),
219                ::core::stringify!(new),
220            )
221        });
222        <Self as IValueTypeMethods>::ctor(this);
223        this
224    }
225}
226
227#[cfg(feature = "system-valuetype")]
228#[doc(hidden)]
229pub mod prelude {
230    pub use super::{IValueType, IValueTypeMethods, ValueType};
231    pub use crate::system::object::IObject;
232    #[cfg(feature = "system-object")]
233    pub use crate::system::object::IObjectMethods;
234}