engage/generated/system/reflection/emit/
methodbuilder.rs1#[cfg(feature = "system-reflection-emit-methodbuilder-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/methodbuilder/MethodBuilder.md"))]
18 #[::unity::class(namespace = "System.Reflection.Emit", name = "MethodBuilder")]
19 #[parent(crate::system::reflection::methodinfo::MethodInfo)]
20 pub struct MethodBuilder {}
21}
22
23#[cfg(feature = "system-reflection-emit-methodbuilder-types")]
24pub use __types::*;
25
26#[cfg(feature = "system-reflection-emit-methodbuilder")]
27pub trait IMethodBuilderMethods: IMethodBuilder {
28 #[doc = "`get_Attributes()` overload"]
29 fn get_attributes(self) -> crate::system::reflection::methodattributes::MethodAttributes {
30 unsafe {
31 let __receiver = <MethodBuilder 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 <MethodBuilder as ::unity::ClassIdentity>::NAME,
44 "get_Attributes",
45 )
46 });
47 let __inner: extern "C" fn(MethodBuilder, ::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 = <MethodBuilder 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 <MethodBuilder as ::unity::ClassIdentity>::NAME,
70 "get_DeclaringType",
71 )
72 });
73 let __inner: extern "C" fn(MethodBuilder, ::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 = <MethodBuilder 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 <MethodBuilder as ::unity::ClassIdentity>::NAME,
95 "get_Name",
96 )
97 });
98 let __inner: extern "C" fn(MethodBuilder, ::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 = "`GetParameters()` overload"]
105 fn get_parameters(self) -> ::unity::Array<crate::system::reflection::parameterinfo::ParameterInfo> {
106 unsafe {
107 let __receiver = <MethodBuilder 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(17usize).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 17usize,
118 __vt.len(),
119 <MethodBuilder as ::unity::ClassIdentity>::NAME,
120 "GetParameters",
121 )
122 });
123 let __inner: extern "C" fn(
124 MethodBuilder,
125 ::unity::OptionalMethod,
126 ) -> ::unity::Array<crate::system::reflection::parameterinfo::ParameterInfo> = ::core::mem::transmute(__vi.method_ptr);
127 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
128 __inner(__receiver, __mi)
129 }
130 }
131 }
132 #[doc = "`get_ReflectedType()` overload"]
133 fn get_reflected_type(self) -> ::unity::SystemType {
134 unsafe {
135 let __receiver = <MethodBuilder as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
136 {
137 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
138 let __vi = *__vt.get(9usize).unwrap_or_else(|| {
139 panic!(
140 "unity: virtual slot {}
141 out of range (vtable len {}
142) on the runtime class behind {}
143 (method `{}
144`)",
145 9usize,
146 __vt.len(),
147 <MethodBuilder as ::unity::ClassIdentity>::NAME,
148 "get_ReflectedType",
149 )
150 });
151 let __inner: extern "C" fn(MethodBuilder, ::unity::OptionalMethod) -> ::unity::SystemType = ::core::mem::transmute(__vi.method_ptr);
152 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
153 __inner(__receiver, __mi)
154 }
155 }
156 }
157 #[doc = "`GetCustomAttributes(bool)` overload"]
158 fn get_custom_attributes(self, inherit: impl ::core::convert::Into<bool>) -> ::unity::Array<crate::system::object::Object> {
159 unsafe {
160 let __receiver = <MethodBuilder as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
161 {
162 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
163 let __vi = *__vt.get(10usize).unwrap_or_else(|| {
164 panic!(
165 "unity: virtual slot {}
166 out of range (vtable len {}
167) on the runtime class behind {}
168 (method `{}
169`)",
170 10usize,
171 __vt.len(),
172 <MethodBuilder as ::unity::ClassIdentity>::NAME,
173 "GetCustomAttributes",
174 )
175 });
176 let __inner: extern "C" fn(MethodBuilder, bool, ::unity::OptionalMethod) -> ::unity::Array<crate::system::object::Object> =
177 ::core::mem::transmute(__vi.method_ptr);
178 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
179 __inner(__receiver, ::core::convert::Into::into(inherit), __mi)
180 }
181 }
182 }
183 #[doc = "`GetCustomAttributes(::unity::SystemType, bool)` overload"]
184 fn get_custom_attributes_2(
185 self,
186 attribute_type: impl ::core::convert::Into<::unity::SystemType>,
187 inherit: impl ::core::convert::Into<bool>,
188 ) -> ::unity::Array<crate::system::object::Object> {
189 unsafe {
190 let __receiver = <MethodBuilder as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
191 {
192 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
193 let __vi = *__vt.get(11usize).unwrap_or_else(|| {
194 panic!(
195 "unity: virtual slot {}
196 out of range (vtable len {}
197) on the runtime class behind {}
198 (method `{}
199`)",
200 11usize,
201 __vt.len(),
202 <MethodBuilder as ::unity::ClassIdentity>::NAME,
203 "GetCustomAttributes",
204 )
205 });
206 let __inner: extern "C" fn(
207 MethodBuilder,
208 ::unity::SystemType,
209 bool,
210 ::unity::OptionalMethod,
211 ) -> ::unity::Array<crate::system::object::Object> = ::core::mem::transmute(__vi.method_ptr);
212 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
213 __inner(
214 __receiver,
215 ::core::convert::Into::into(attribute_type),
216 ::core::convert::Into::into(inherit),
217 __mi,
218 )
219 }
220 }
221 }
222 #[doc = "`GetMethodImplementationFlags()` overload"]
223 fn get_method_implementation_flags(self) -> crate::system::reflection::methodimplattributes::MethodImplAttributes {
224 unsafe {
225 let __receiver = <MethodBuilder 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(18usize).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 18usize,
236 __vt.len(),
237 <MethodBuilder as ::unity::ClassIdentity>::NAME,
238 "GetMethodImplementationFlags",
239 )
240 });
241 let __inner: extern "C" fn(
242 MethodBuilder,
243 ::unity::OptionalMethod,
244 ) -> crate::system::reflection::methodimplattributes::MethodImplAttributes = ::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 = <MethodBuilder 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 <MethodBuilder as ::unity::ClassIdentity>::NAME,
266 "IsDefined",
267 )
268 });
269 let __inner: extern "C" fn(MethodBuilder, ::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-methodbuilder")]
284impl<__T: IMethodBuilder> IMethodBuilderMethods for __T {}
285
286#[cfg(feature = "system-reflection-emit-methodbuilder")]
287impl MethodBuilder {
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()[2]
298 }
299
300 pub fn get_parameters_method_info() -> &'static ::unity::il2cpp::MethodInfo {
301 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
302 }
303
304 pub fn get_reflected_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
305 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
306 }
307
308 pub fn get_custom_attributes_method_info() -> &'static ::unity::il2cpp::MethodInfo {
309 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
310 }
311
312 pub fn get_custom_attributes_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
313 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
314 }
315
316 pub fn get_method_implementation_flags_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-methodbuilder")]
326impl MethodBuilder {
327 #[doc = "Direct (non-virtual) call to `MethodBuilder`'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 `MethodBuilder`'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 `MethodBuilder`'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 `MethodBuilder`'s own `GetParameters`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
352 pub unsafe fn get_parameters(
353 this: impl ::core::convert::Into<::unity::IlInstance>,
354 ) -> ::unity::Array<crate::system::reflection::parameterinfo::ParameterInfo> {
355 let __mi = Self::get_parameters_method_info();
356 let __inner: extern "C" fn(
357 ::unity::IlInstance,
358 ::unity::OptionalMethod,
359 ) -> ::unity::Array<crate::system::reflection::parameterinfo::ParameterInfo> = ::core::mem::transmute(__mi.method_ptr);
360 __inner(this.into(), ::core::option::Option::None)
361 }
362
363 #[doc = "Direct (non-virtual) call to `MethodBuilder`'s own `get_ReflectedType`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
364 pub unsafe fn get_reflected_type(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::SystemType {
365 let __mi = Self::get_reflected_type_method_info();
366 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::SystemType = ::core::mem::transmute(__mi.method_ptr);
367 __inner(this.into(), ::core::option::Option::None)
368 }
369
370 #[doc = "Direct (non-virtual) call to `MethodBuilder`'s own `GetCustomAttributes`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
371 pub unsafe fn get_custom_attributes(
372 this: impl ::core::convert::Into<::unity::IlInstance>,
373 inherit: bool,
374 ) -> ::unity::Array<crate::system::object::Object> {
375 let __mi = Self::get_custom_attributes_method_info();
376 let __inner: extern "C" fn(::unity::IlInstance, bool, ::unity::OptionalMethod) -> ::unity::Array<crate::system::object::Object> =
377 ::core::mem::transmute(__mi.method_ptr);
378 __inner(this.into(), inherit, ::core::option::Option::None)
379 }
380
381 #[doc = "Direct (non-virtual) call to `MethodBuilder`'s own `GetCustomAttributes`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
382 pub unsafe fn get_custom_attributes_2(
383 this: impl ::core::convert::Into<::unity::IlInstance>,
384 attribute_type: ::unity::SystemType,
385 inherit: bool,
386 ) -> ::unity::Array<crate::system::object::Object> {
387 let __mi = Self::get_custom_attributes_2_method_info();
388 let __inner: extern "C" fn(
389 ::unity::IlInstance,
390 ::unity::SystemType,
391 bool,
392 ::unity::OptionalMethod,
393 ) -> ::unity::Array<crate::system::object::Object> = ::core::mem::transmute(__mi.method_ptr);
394 __inner(this.into(), attribute_type, inherit, ::core::option::Option::None)
395 }
396
397 #[doc = "Direct (non-virtual) call to `MethodBuilder`'s own `GetMethodImplementationFlags`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
398 pub unsafe fn get_method_implementation_flags(
399 this: impl ::core::convert::Into<::unity::IlInstance>,
400 ) -> crate::system::reflection::methodimplattributes::MethodImplAttributes {
401 let __mi = Self::get_method_implementation_flags_method_info();
402 let __inner: extern "C" fn(
403 ::unity::IlInstance,
404 ::unity::OptionalMethod,
405 ) -> crate::system::reflection::methodimplattributes::MethodImplAttributes = ::core::mem::transmute(__mi.method_ptr);
406 __inner(this.into(), ::core::option::Option::None)
407 }
408
409 #[doc = "Direct (non-virtual) call to `MethodBuilder`'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-methodbuilder")]
419#[doc(hidden)]
420pub mod prelude {
421 pub use super::{IMethodBuilder, IMethodBuilderMethods, MethodBuilder};
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}