Skip to main content

engage/generated/system/reflection/
monoassembly.rs

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