engage/generated/system/reflection/
module.rs1#[cfg(feature = "system-reflection-module-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/reflection/module/Module.md"))]
11 #[::unity::class(namespace = "System.Reflection", name = "Module")]
12 #[parent(crate::system::object::Object)]
13 pub struct Module {
14 #[static_field]
15 #[rename(name = "FilterTypeName")]
16 pub filter_type_name: crate::system::reflection::typefilter::TypeFilter,
17 #[static_field]
18 #[rename(name = "FilterTypeNameIgnoreCase")]
19 pub filter_type_name_ignore_case: crate::system::reflection::typefilter::TypeFilter,
20 #[offset(16)]
21 #[rename(name = "_impl")]
22 pub r#impl: ::unity::IntPtr,
23 #[offset(24)]
24 #[rename(name = "assembly")]
25 pub assembly: crate::system::reflection::assembly::Assembly,
26 #[offset(32)]
27 #[rename(name = "fqname")]
28 pub fqname: ::unity::Il2CppString,
29 #[offset(40)]
30 #[rename(name = "name")]
31 pub name: ::unity::Il2CppString,
32 #[offset(48)]
33 #[rename(name = "scopename")]
34 pub scopename: ::unity::Il2CppString,
35 #[offset(56)]
36 #[rename(name = "is_resource")]
37 pub is_resource_field: bool,
38 #[offset(60)]
39 #[rename(name = "token")]
40 pub token: i32,
41 #[static_field]
42 #[rename(name = "defaultBindingFlags")]
43 pub default_binding_flags: crate::system::reflection::bindingflags::BindingFlags,
44 }
45}
46
47#[cfg(feature = "system-reflection-module-types")]
48pub use __types::*;
49
50#[cfg(feature = "system-reflection-module")]
51impl Module {
52 #[doc = "`filter_by_type_name(::unity::SystemType, crate::system::object::Object)` overload"]
53 pub fn filter_by_type_name(
54 m: impl ::core::convert::Into<::unity::SystemType>,
55 filter_criteria: impl ::core::convert::Into<crate::system::object::Object>,
56 ) -> bool {
57 unsafe {
58 ::unity::il2cpp_call!((::unity::module_base()+0x337a850usize)as*mut u8,bool;
59(::unity::SystemType)::core::convert::Into::into(m),(crate::system::object::Object)::core::convert::Into::into(filter_criteria))
60 }
61 }
62
63 #[doc = "`filter_by_type_name_ignore_case(::unity::SystemType, crate::system::object::Object)` overload"]
64 pub fn filter_by_type_name_ignore_case(
65 m: impl ::core::convert::Into<::unity::SystemType>,
66 filter_criteria: impl ::core::convert::Into<crate::system::object::Object>,
67 ) -> bool {
68 unsafe {
69 ::unity::il2cpp_call!((::unity::module_base()+0x337a940usize)as*mut u8,bool;
70(::unity::SystemType)::core::convert::Into::into(m),(crate::system::object::Object)::core::convert::Into::into(filter_criteria))
71 }
72 }
73
74 #[doc = "`op_Equality(crate::system::reflection::module::Module, crate::system::reflection::module::Module)` overload"]
75 pub fn op_equality(
76 left: impl ::core::convert::Into<crate::system::reflection::module::Module>,
77 right: impl ::core::convert::Into<crate::system::reflection::module::Module>,
78 ) -> bool {
79 unsafe {
80 ::unity::il2cpp_call!((::unity::module_base()+0x337aa70usize)as*mut u8,bool;
81(crate::system::reflection::module::Module)::core::convert::Into::into(left),(crate::system::reflection::module::Module)::core::convert::Into::into(right))
82 }
83 }
84
85 #[doc = "`.cctor()` overload"]
86 pub fn cctor() -> () {
87 unsafe {
88 ::unity::il2cpp_call!((::unity::module_base()+0x337add0usize)as*mut u8,();
89 )
90 }
91 }
92}
93
94#[cfg(feature = "system-reflection-module")]
95pub trait IModuleMethods: IModule {
96 #[doc = "`.ctor()` overload"]
97 fn ctor(self) -> () {
98 unsafe {
99 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
100 ::unity::il2cpp_call!((::unity::module_base()+0x337a7a0usize)as*mut u8,();
101(Module)__receiver)
102 }
103 }
104 #[doc = "`ToString()` overload"]
105 fn to_string(self) -> ::unity::Il2CppString {
106 unsafe {
107 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
108 {
109 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
110 let __vi = *__vt.get(3usize).unwrap_or_else(|| {
111 panic!(
112 "unity: virtual slot {}
113 out of range (vtable len {}
114) on the runtime class behind {}
115 (method `{}
116`)",
117 3usize,
118 __vt.len(),
119 <Module as ::unity::ClassIdentity>::NAME,
120 "ToString",
121 )
122 });
123 let __inner: extern "C" fn(Module, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__vi.method_ptr);
124 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
125 __inner(__receiver, __mi)
126 }
127 }
128 }
129 #[doc = "`GetGuidInternal()` overload"]
130 fn get_guid_internal(self) -> ::unity::Il2CppString {
131 unsafe {
132 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
133 ::unity::il2cpp_call!((::unity::module_base()+0x337a840usize)as*mut u8, ::unity::Il2CppString;
134(Module)__receiver)
135 }
136 }
137 #[doc = "`Equals(crate::system::object::Object)` overload"]
138 fn equals(self, o: impl ::core::convert::Into<crate::system::object::Object>) -> bool {
139 unsafe {
140 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
141 {
142 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
143 let __vi = *__vt.get(0usize).unwrap_or_else(|| {
144 panic!(
145 "unity: virtual slot {}
146 out of range (vtable len {}
147) on the runtime class behind {}
148 (method `{}
149`)",
150 0usize,
151 __vt.len(),
152 <Module as ::unity::ClassIdentity>::NAME,
153 "Equals",
154 )
155 });
156 let __inner: extern "C" fn(Module, crate::system::object::Object, ::unity::OptionalMethod) -> bool =
157 ::core::mem::transmute(__vi.method_ptr);
158 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
159 __inner(__receiver, ::core::convert::Into::into(o), __mi)
160 }
161 }
162 }
163 #[doc = "`GetHashCode()` overload"]
164 fn get_hash_code(self) -> i32 {
165 unsafe {
166 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
167 {
168 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
169 let __vi = *__vt.get(2usize).unwrap_or_else(|| {
170 panic!(
171 "unity: virtual slot {}
172 out of range (vtable len {}
173) on the runtime class behind {}
174 (method `{}
175`)",
176 2usize,
177 __vt.len(),
178 <Module as ::unity::ClassIdentity>::NAME,
179 "GetHashCode",
180 )
181 });
182 let __inner: extern "C" fn(Module, ::unity::OptionalMethod) -> i32 = ::core::mem::transmute(__vi.method_ptr);
183 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
184 __inner(__receiver, __mi)
185 }
186 }
187 }
188 #[doc = "`get_Assembly()` overload"]
189 fn get_assembly(self) -> crate::system::reflection::assembly::Assembly {
190 unsafe {
191 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
192 {
193 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
194 let __vi = *__vt.get(9usize).unwrap_or_else(|| {
195 panic!(
196 "unity: virtual slot {}
197 out of range (vtable len {}
198) on the runtime class behind {}
199 (method `{}
200`)",
201 9usize,
202 __vt.len(),
203 <Module as ::unity::ClassIdentity>::NAME,
204 "get_Assembly",
205 )
206 });
207 let __inner: extern "C" fn(Module, ::unity::OptionalMethod) -> crate::system::reflection::assembly::Assembly =
208 ::core::mem::transmute(__vi.method_ptr);
209 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
210 __inner(__receiver, __mi)
211 }
212 }
213 }
214 #[doc = "`get_ScopeName()` overload"]
215 fn get_scope_name(self) -> ::unity::Il2CppString {
216 unsafe {
217 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
218 {
219 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
220 let __vi = *__vt.get(10usize).unwrap_or_else(|| {
221 panic!(
222 "unity: virtual slot {}
223 out of range (vtable len {}
224) on the runtime class behind {}
225 (method `{}
226`)",
227 10usize,
228 __vt.len(),
229 <Module as ::unity::ClassIdentity>::NAME,
230 "get_ScopeName",
231 )
232 });
233 let __inner: extern "C" fn(Module, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__vi.method_ptr);
234 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
235 __inner(__receiver, __mi)
236 }
237 }
238 }
239 #[doc = "`IsResource()` overload"]
240 fn is_resource(self) -> bool {
241 unsafe {
242 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
243 {
244 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
245 let __vi = *__vt.get(12usize).unwrap_or_else(|| {
246 panic!(
247 "unity: virtual slot {}
248 out of range (vtable len {}
249) on the runtime class behind {}
250 (method `{}
251`)",
252 12usize,
253 __vt.len(),
254 <Module as ::unity::ClassIdentity>::NAME,
255 "IsResource",
256 )
257 });
258 let __inner: extern "C" fn(Module, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__vi.method_ptr);
259 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
260 __inner(__receiver, __mi)
261 }
262 }
263 }
264 #[doc = "`GetCustomAttributes(::unity::SystemType, bool)` overload"]
265 fn get_custom_attributes(
266 self,
267 attribute_type: impl ::core::convert::Into<::unity::SystemType>,
268 inherit: impl ::core::convert::Into<bool>,
269 ) -> ::unity::Array<crate::system::object::Object> {
270 unsafe {
271 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
272 {
273 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
274 let __vi = *__vt.get(13usize).unwrap_or_else(|| {
275 panic!(
276 "unity: virtual slot {}
277 out of range (vtable len {}
278) on the runtime class behind {}
279 (method `{}
280`)",
281 13usize,
282 __vt.len(),
283 <Module as ::unity::ClassIdentity>::NAME,
284 "GetCustomAttributes",
285 )
286 });
287 let __inner: extern "C" fn(
288 Module,
289 ::unity::SystemType,
290 bool,
291 ::unity::OptionalMethod,
292 ) -> ::unity::Array<crate::system::object::Object> = ::core::mem::transmute(__vi.method_ptr);
293 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
294 __inner(
295 __receiver,
296 ::core::convert::Into::into(attribute_type),
297 ::core::convert::Into::into(inherit),
298 __mi,
299 )
300 }
301 }
302 }
303 #[doc = "`IsDefined(::unity::SystemType, bool)` overload"]
304 fn is_defined(self, attribute_type: impl ::core::convert::Into<::unity::SystemType>, inherit: impl ::core::convert::Into<bool>) -> bool {
305 unsafe {
306 let __receiver = <Module as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
307 {
308 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
309 let __vi = *__vt.get(14usize).unwrap_or_else(|| {
310 panic!(
311 "unity: virtual slot {}
312 out of range (vtable len {}
313) on the runtime class behind {}
314 (method `{}
315`)",
316 14usize,
317 __vt.len(),
318 <Module as ::unity::ClassIdentity>::NAME,
319 "IsDefined",
320 )
321 });
322 let __inner: extern "C" fn(Module, ::unity::SystemType, bool, ::unity::OptionalMethod) -> bool =
323 ::core::mem::transmute(__vi.method_ptr);
324 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
325 __inner(
326 __receiver,
327 ::core::convert::Into::into(attribute_type),
328 ::core::convert::Into::into(inherit),
329 __mi,
330 )
331 }
332 }
333 }
334}
335
336#[cfg(feature = "system-reflection-module")]
337impl<__T: IModule> IModuleMethods for __T {}
338
339#[cfg(feature = "system-reflection-module")]
340impl Module {
341 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
342 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
343 }
344
345 pub fn to_string_method_info() -> &'static ::unity::il2cpp::MethodInfo {
346 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
347 }
348
349 pub fn filter_by_type_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
350 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
351 }
352
353 pub fn filter_by_type_name_ignore_case_method_info() -> &'static ::unity::il2cpp::MethodInfo {
354 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
355 }
356
357 pub fn get_guid_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
358 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
359 }
360
361 pub fn equals_method_info() -> &'static ::unity::il2cpp::MethodInfo {
362 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
363 }
364
365 pub fn get_hash_code_method_info() -> &'static ::unity::il2cpp::MethodInfo {
366 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
367 }
368
369 pub fn op_equality_method_info() -> &'static ::unity::il2cpp::MethodInfo {
370 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
371 }
372
373 pub fn get_assembly_method_info() -> &'static ::unity::il2cpp::MethodInfo {
374 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
375 }
376
377 pub fn get_scope_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
378 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
379 }
380
381 pub fn is_resource_method_info() -> &'static ::unity::il2cpp::MethodInfo {
382 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
383 }
384
385 pub fn get_custom_attributes_method_info() -> &'static ::unity::il2cpp::MethodInfo {
386 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
387 }
388
389 pub fn is_defined_method_info() -> &'static ::unity::il2cpp::MethodInfo {
390 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[16]
391 }
392
393 pub fn cctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
394 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[17]
395 }
396}
397
398#[cfg(feature = "system-reflection-module")]
399impl Module {
400 #[doc = "Direct (non-virtual) call to `Module`'s own `ToString`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
401 pub unsafe fn to_string(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
402 let __mi = Self::to_string_method_info();
403 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
404 __inner(this.into(), ::core::option::Option::None)
405 }
406
407 #[doc = "Direct (non-virtual) call to `Module`'s own `Equals`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
408 pub unsafe fn equals(this: impl ::core::convert::Into<::unity::IlInstance>, o: crate::system::object::Object) -> bool {
409 let __mi = Self::equals_method_info();
410 let __inner: extern "C" fn(::unity::IlInstance, crate::system::object::Object, ::unity::OptionalMethod) -> bool =
411 ::core::mem::transmute(__mi.method_ptr);
412 __inner(this.into(), o, ::core::option::Option::None)
413 }
414
415 #[doc = "Direct (non-virtual) call to `Module`'s own `GetHashCode`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
416 pub unsafe fn get_hash_code(this: impl ::core::convert::Into<::unity::IlInstance>) -> i32 {
417 let __mi = Self::get_hash_code_method_info();
418 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> i32 = ::core::mem::transmute(__mi.method_ptr);
419 __inner(this.into(), ::core::option::Option::None)
420 }
421
422 #[doc = "Direct (non-virtual) call to `Module`'s own `get_Assembly`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
423 pub unsafe fn get_assembly(this: impl ::core::convert::Into<::unity::IlInstance>) -> crate::system::reflection::assembly::Assembly {
424 let __mi = Self::get_assembly_method_info();
425 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> crate::system::reflection::assembly::Assembly =
426 ::core::mem::transmute(__mi.method_ptr);
427 __inner(this.into(), ::core::option::Option::None)
428 }
429
430 #[doc = "Direct (non-virtual) call to `Module`'s own `get_ScopeName`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
431 pub unsafe fn get_scope_name(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
432 let __mi = Self::get_scope_name_method_info();
433 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
434 __inner(this.into(), ::core::option::Option::None)
435 }
436
437 #[doc = "Direct (non-virtual) call to `Module`'s own `IsResource`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
438 pub unsafe fn is_resource(this: impl ::core::convert::Into<::unity::IlInstance>) -> bool {
439 let __mi = Self::is_resource_method_info();
440 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__mi.method_ptr);
441 __inner(this.into(), ::core::option::Option::None)
442 }
443
444 #[doc = "Direct (non-virtual) call to `Module`'s own `GetCustomAttributes`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
445 pub unsafe fn get_custom_attributes(
446 this: impl ::core::convert::Into<::unity::IlInstance>,
447 attribute_type: ::unity::SystemType,
448 inherit: bool,
449 ) -> ::unity::Array<crate::system::object::Object> {
450 let __mi = Self::get_custom_attributes_method_info();
451 let __inner: extern "C" fn(
452 ::unity::IlInstance,
453 ::unity::SystemType,
454 bool,
455 ::unity::OptionalMethod,
456 ) -> ::unity::Array<crate::system::object::Object> = ::core::mem::transmute(__mi.method_ptr);
457 __inner(this.into(), attribute_type, inherit, ::core::option::Option::None)
458 }
459
460 #[doc = "Direct (non-virtual) call to `Module`'s own `IsDefined`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
461 pub unsafe fn is_defined(this: impl ::core::convert::Into<::unity::IlInstance>, attribute_type: ::unity::SystemType, inherit: bool) -> bool {
462 let __mi = Self::is_defined_method_info();
463 let __inner: extern "C" fn(::unity::IlInstance, ::unity::SystemType, bool, ::unity::OptionalMethod) -> bool =
464 ::core::mem::transmute(__mi.method_ptr);
465 __inner(this.into(), attribute_type, inherit, ::core::option::Option::None)
466 }
467}
468
469#[cfg(feature = "system-reflection-module")]
470impl Module {
471 #[doc = "`.ctor()` — no args"]
472 pub fn new() -> Self {
473 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
474 panic!(
475 "{}
476::{}
477 failed to instantiate",
478 ::core::stringify!(Module),
479 ::core::stringify!(new),
480 )
481 });
482 <Self as IModuleMethods>::ctor(this);
483 this
484 }
485}
486
487#[cfg(feature = "system-reflection-module")]
488#[doc(hidden)]
489pub mod prelude {
490 pub use super::{IModule, IModuleMethods, Module};
491 pub use crate::system::object::IObject;
492 #[cfg(feature = "system-object")]
493 pub use crate::system::object::IObjectMethods;
494}