engage/generated/system/reflection/emit/
dynamicmethod.rs1#[cfg(feature = "system-reflection-emit-dynamicmethod-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::{
9 object::{IObject, Object},
10 reflection::{
11 memberinfo::{IMemberInfo, MemberInfo},
12 methodbase::{IMethodBase, MethodBase},
13 methodinfo::{IMethodInfo, MethodInfo},
14 },
15 };
16
17 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/reflection/emit/dynamicmethod/DynamicMethod.md"))]
18 #[::unity::class(namespace = "System.Reflection.Emit", name = "DynamicMethod")]
19 #[parent(crate::system::reflection::methodinfo::MethodInfo)]
20 pub struct DynamicMethod {}
21}
22
23#[cfg(feature = "system-reflection-emit-dynamicmethod-types")]
24pub use __types::*;
25
26#[cfg(feature = "system-reflection-emit-dynamicmethod")]
27pub trait IDynamicMethodMethods: IDynamicMethod {
28 #[doc = "`get_Attributes()` overload"]
29 fn get_attributes(self) -> crate::system::reflection::methodattributes::MethodAttributes {
30 unsafe {
31 let __receiver = <DynamicMethod as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
32 {
33 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
34 let __vi = *__vt.get(20usize).unwrap_or_else(|| {
35 panic!(
36 "unity: virtual slot {}
37 out of range (vtable len {}
38) on the runtime class behind {}
39 (method `{}
40`)",
41 20usize,
42 __vt.len(),
43 <DynamicMethod as ::unity::ClassIdentity>::NAME,
44 "get_Attributes",
45 )
46 });
47 let __inner: extern "C" fn(DynamicMethod, ::unity::OptionalMethod) -> crate::system::reflection::methodattributes::MethodAttributes =
48 ::core::mem::transmute(__vi.method_ptr);
49 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
50 __inner(__receiver, __mi)
51 }
52 }
53 }
54 #[doc = "`get_DeclaringType()` overload"]
55 fn get_declaring_type(self) -> ::unity::SystemType {
56 unsafe {
57 let __receiver = <DynamicMethod as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
58 {
59 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
60 let __vi = *__vt.get(8usize).unwrap_or_else(|| {
61 panic!(
62 "unity: virtual slot {}
63 out of range (vtable len {}
64) on the runtime class behind {}
65 (method `{}
66`)",
67 8usize,
68 __vt.len(),
69 <DynamicMethod as ::unity::ClassIdentity>::NAME,
70 "get_DeclaringType",
71 )
72 });
73 let __inner: extern "C" fn(DynamicMethod, ::unity::OptionalMethod) -> ::unity::SystemType = ::core::mem::transmute(__vi.method_ptr);
74 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
75 __inner(__receiver, __mi)
76 }
77 }
78 }
79 #[doc = "`get_Name()` overload"]
80 fn get_name(self) -> ::unity::Il2CppString {
81 unsafe {
82 let __receiver = <DynamicMethod as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
83 {
84 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
85 let __vi = *__vt.get(7usize).unwrap_or_else(|| {
86 panic!(
87 "unity: virtual slot {}
88 out of range (vtable len {}
89) on the runtime class behind {}
90 (method `{}
91`)",
92 7usize,
93 __vt.len(),
94 <DynamicMethod as ::unity::ClassIdentity>::NAME,
95 "get_Name",
96 )
97 });
98 let __inner: extern "C" fn(DynamicMethod, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__vi.method_ptr);
99 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
100 __inner(__receiver, __mi)
101 }
102 }
103 }
104 #[doc = "`get_ReflectedType()` overload"]
105 fn get_reflected_type(self) -> ::unity::SystemType {
106 unsafe {
107 let __receiver = <DynamicMethod 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(9usize).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 9usize,
118 __vt.len(),
119 <DynamicMethod as ::unity::ClassIdentity>::NAME,
120 "get_ReflectedType",
121 )
122 });
123 let __inner: extern "C" fn(DynamicMethod, ::unity::OptionalMethod) -> ::unity::SystemType = ::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 = "`GetCustomAttributes(bool)` overload"]
130 fn get_custom_attributes(self, inherit: impl ::core::convert::Into<bool>) -> ::unity::Array<crate::system::object::Object> {
131 unsafe {
132 let __receiver = <DynamicMethod as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
133 {
134 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
135 let __vi = *__vt.get(10usize).unwrap_or_else(|| {
136 panic!(
137 "unity: virtual slot {}
138 out of range (vtable len {}
139) on the runtime class behind {}
140 (method `{}
141`)",
142 10usize,
143 __vt.len(),
144 <DynamicMethod as ::unity::ClassIdentity>::NAME,
145 "GetCustomAttributes",
146 )
147 });
148 let __inner: extern "C" fn(DynamicMethod, bool, ::unity::OptionalMethod) -> ::unity::Array<crate::system::object::Object> =
149 ::core::mem::transmute(__vi.method_ptr);
150 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
151 __inner(__receiver, ::core::convert::Into::into(inherit), __mi)
152 }
153 }
154 }
155 #[doc = "`GetCustomAttributes(::unity::SystemType, bool)` overload"]
156 fn get_custom_attributes_2(
157 self,
158 attribute_type: impl ::core::convert::Into<::unity::SystemType>,
159 inherit: impl ::core::convert::Into<bool>,
160 ) -> ::unity::Array<crate::system::object::Object> {
161 unsafe {
162 let __receiver = <DynamicMethod as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
163 {
164 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
165 let __vi = *__vt.get(11usize).unwrap_or_else(|| {
166 panic!(
167 "unity: virtual slot {}
168 out of range (vtable len {}
169) on the runtime class behind {}
170 (method `{}
171`)",
172 11usize,
173 __vt.len(),
174 <DynamicMethod as ::unity::ClassIdentity>::NAME,
175 "GetCustomAttributes",
176 )
177 });
178 let __inner: extern "C" fn(
179 DynamicMethod,
180 ::unity::SystemType,
181 bool,
182 ::unity::OptionalMethod,
183 ) -> ::unity::Array<crate::system::object::Object> = ::core::mem::transmute(__vi.method_ptr);
184 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
185 __inner(
186 __receiver,
187 ::core::convert::Into::into(attribute_type),
188 ::core::convert::Into::into(inherit),
189 __mi,
190 )
191 }
192 }
193 }
194 #[doc = "`GetMethodImplementationFlags()` overload"]
195 fn get_method_implementation_flags(self) -> crate::system::reflection::methodimplattributes::MethodImplAttributes {
196 unsafe {
197 let __receiver = <DynamicMethod as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
198 {
199 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
200 let __vi = *__vt.get(18usize).unwrap_or_else(|| {
201 panic!(
202 "unity: virtual slot {}
203 out of range (vtable len {}
204) on the runtime class behind {}
205 (method `{}
206`)",
207 18usize,
208 __vt.len(),
209 <DynamicMethod as ::unity::ClassIdentity>::NAME,
210 "GetMethodImplementationFlags",
211 )
212 });
213 let __inner: extern "C" fn(
214 DynamicMethod,
215 ::unity::OptionalMethod,
216 ) -> crate::system::reflection::methodimplattributes::MethodImplAttributes = ::core::mem::transmute(__vi.method_ptr);
217 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
218 __inner(__receiver, __mi)
219 }
220 }
221 }
222 #[doc = "`GetParameters()` overload"]
223 fn get_parameters(self) -> ::unity::Array<crate::system::reflection::parameterinfo::ParameterInfo> {
224 unsafe {
225 let __receiver = <DynamicMethod as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
226 {
227 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
228 let __vi = *__vt.get(17usize).unwrap_or_else(|| {
229 panic!(
230 "unity: virtual slot {}
231 out of range (vtable len {}
232) on the runtime class behind {}
233 (method `{}
234`)",
235 17usize,
236 __vt.len(),
237 <DynamicMethod as ::unity::ClassIdentity>::NAME,
238 "GetParameters",
239 )
240 });
241 let __inner: extern "C" fn(
242 DynamicMethod,
243 ::unity::OptionalMethod,
244 ) -> ::unity::Array<crate::system::reflection::parameterinfo::ParameterInfo> = ::core::mem::transmute(__vi.method_ptr);
245 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
246 __inner(__receiver, __mi)
247 }
248 }
249 }
250 #[doc = "`IsDefined(::unity::SystemType, bool)` overload"]
251 fn is_defined(self, attribute_type: impl ::core::convert::Into<::unity::SystemType>, inherit: impl ::core::convert::Into<bool>) -> bool {
252 unsafe {
253 let __receiver = <DynamicMethod as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
254 {
255 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
256 let __vi = *__vt.get(12usize).unwrap_or_else(|| {
257 panic!(
258 "unity: virtual slot {}
259 out of range (vtable len {}
260) on the runtime class behind {}
261 (method `{}
262`)",
263 12usize,
264 __vt.len(),
265 <DynamicMethod as ::unity::ClassIdentity>::NAME,
266 "IsDefined",
267 )
268 });
269 let __inner: extern "C" fn(DynamicMethod, ::unity::SystemType, bool, ::unity::OptionalMethod) -> bool =
270 ::core::mem::transmute(__vi.method_ptr);
271 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
272 __inner(
273 __receiver,
274 ::core::convert::Into::into(attribute_type),
275 ::core::convert::Into::into(inherit),
276 __mi,
277 )
278 }
279 }
280 }
281}
282
283#[cfg(feature = "system-reflection-emit-dynamicmethod")]
284impl<__T: IDynamicMethod> IDynamicMethodMethods for __T {}
285
286#[cfg(feature = "system-reflection-emit-dynamicmethod")]
287impl DynamicMethod {
288 pub fn get_attributes_method_info() -> &'static ::unity::il2cpp::MethodInfo {
289 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
290 }
291
292 pub fn get_declaring_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
293 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
294 }
295
296 pub fn get_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
297 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
298 }
299
300 pub fn get_reflected_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
301 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
302 }
303
304 pub fn get_custom_attributes_method_info() -> &'static ::unity::il2cpp::MethodInfo {
305 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
306 }
307
308 pub fn get_custom_attributes_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
309 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
310 }
311
312 pub fn get_method_implementation_flags_method_info() -> &'static ::unity::il2cpp::MethodInfo {
313 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
314 }
315
316 pub fn get_parameters_method_info() -> &'static ::unity::il2cpp::MethodInfo {
317 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
318 }
319
320 pub fn is_defined_method_info() -> &'static ::unity::il2cpp::MethodInfo {
321 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
322 }
323}
324
325#[cfg(feature = "system-reflection-emit-dynamicmethod")]
326impl DynamicMethod {
327 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `get_Attributes`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
328 pub unsafe fn get_attributes(
329 this: impl ::core::convert::Into<::unity::IlInstance>,
330 ) -> crate::system::reflection::methodattributes::MethodAttributes {
331 let __mi = Self::get_attributes_method_info();
332 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> crate::system::reflection::methodattributes::MethodAttributes =
333 ::core::mem::transmute(__mi.method_ptr);
334 __inner(this.into(), ::core::option::Option::None)
335 }
336
337 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `get_DeclaringType`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
338 pub unsafe fn get_declaring_type(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::SystemType {
339 let __mi = Self::get_declaring_type_method_info();
340 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::SystemType = ::core::mem::transmute(__mi.method_ptr);
341 __inner(this.into(), ::core::option::Option::None)
342 }
343
344 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `get_Name`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
345 pub unsafe fn get_name(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
346 let __mi = Self::get_name_method_info();
347 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
348 __inner(this.into(), ::core::option::Option::None)
349 }
350
351 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `get_ReflectedType`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
352 pub unsafe fn get_reflected_type(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::SystemType {
353 let __mi = Self::get_reflected_type_method_info();
354 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::SystemType = ::core::mem::transmute(__mi.method_ptr);
355 __inner(this.into(), ::core::option::Option::None)
356 }
357
358 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `GetCustomAttributes`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
359 pub unsafe fn get_custom_attributes(
360 this: impl ::core::convert::Into<::unity::IlInstance>,
361 inherit: bool,
362 ) -> ::unity::Array<crate::system::object::Object> {
363 let __mi = Self::get_custom_attributes_method_info();
364 let __inner: extern "C" fn(::unity::IlInstance, bool, ::unity::OptionalMethod) -> ::unity::Array<crate::system::object::Object> =
365 ::core::mem::transmute(__mi.method_ptr);
366 __inner(this.into(), inherit, ::core::option::Option::None)
367 }
368
369 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `GetCustomAttributes`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
370 pub unsafe fn get_custom_attributes_2(
371 this: impl ::core::convert::Into<::unity::IlInstance>,
372 attribute_type: ::unity::SystemType,
373 inherit: bool,
374 ) -> ::unity::Array<crate::system::object::Object> {
375 let __mi = Self::get_custom_attributes_2_method_info();
376 let __inner: extern "C" fn(
377 ::unity::IlInstance,
378 ::unity::SystemType,
379 bool,
380 ::unity::OptionalMethod,
381 ) -> ::unity::Array<crate::system::object::Object> = ::core::mem::transmute(__mi.method_ptr);
382 __inner(this.into(), attribute_type, inherit, ::core::option::Option::None)
383 }
384
385 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `GetMethodImplementationFlags`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
386 pub unsafe fn get_method_implementation_flags(
387 this: impl ::core::convert::Into<::unity::IlInstance>,
388 ) -> crate::system::reflection::methodimplattributes::MethodImplAttributes {
389 let __mi = Self::get_method_implementation_flags_method_info();
390 let __inner: extern "C" fn(
391 ::unity::IlInstance,
392 ::unity::OptionalMethod,
393 ) -> crate::system::reflection::methodimplattributes::MethodImplAttributes = ::core::mem::transmute(__mi.method_ptr);
394 __inner(this.into(), ::core::option::Option::None)
395 }
396
397 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `GetParameters`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
398 pub unsafe fn get_parameters(
399 this: impl ::core::convert::Into<::unity::IlInstance>,
400 ) -> ::unity::Array<crate::system::reflection::parameterinfo::ParameterInfo> {
401 let __mi = Self::get_parameters_method_info();
402 let __inner: extern "C" fn(
403 ::unity::IlInstance,
404 ::unity::OptionalMethod,
405 ) -> ::unity::Array<crate::system::reflection::parameterinfo::ParameterInfo> = ::core::mem::transmute(__mi.method_ptr);
406 __inner(this.into(), ::core::option::Option::None)
407 }
408
409 #[doc = "Direct (non-virtual) call to `DynamicMethod`'s own `IsDefined`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
410 pub unsafe fn is_defined(this: impl ::core::convert::Into<::unity::IlInstance>, attribute_type: ::unity::SystemType, inherit: bool) -> bool {
411 let __mi = Self::is_defined_method_info();
412 let __inner: extern "C" fn(::unity::IlInstance, ::unity::SystemType, bool, ::unity::OptionalMethod) -> bool =
413 ::core::mem::transmute(__mi.method_ptr);
414 __inner(this.into(), attribute_type, inherit, ::core::option::Option::None)
415 }
416}
417
418#[cfg(feature = "system-reflection-emit-dynamicmethod")]
419#[doc(hidden)]
420pub mod prelude {
421 pub use super::{DynamicMethod, IDynamicMethod, IDynamicMethodMethods};
422 #[cfg(feature = "system-object")]
423 pub use crate::system::object::IObjectMethods;
424 #[cfg(feature = "system-reflection-memberinfo")]
425 pub use crate::system::reflection::memberinfo::IMemberInfoMethods;
426 #[cfg(feature = "system-reflection-methodbase")]
427 pub use crate::system::reflection::methodbase::IMethodBaseMethods;
428 #[cfg(feature = "system-reflection-methodinfo")]
429 pub use crate::system::reflection::methodinfo::IMethodInfoMethods;
430 pub use crate::system::{
431 object::IObject,
432 reflection::{memberinfo::IMemberInfo, methodbase::IMethodBase, methodinfo::IMethodInfo},
433 };
434}