engage/generated/moon_sharp/interpreter/
moduleregister.rs1#[cfg(feature = "moon_sharp-interpreter-moduleregister-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/moon_sharp/interpreter/moduleregister/ModuleRegister.md"))]
11 #[::unity::class(namespace = "MoonSharp.Interpreter", name = "ModuleRegister")]
12 #[parent(crate::system::object::Object)]
13 pub struct ModuleRegister {}
14}
15
16#[cfg(feature = "moon_sharp-interpreter-moduleregister-types")]
17pub use __types::*;
18
19#[cfg(feature = "moon_sharp-interpreter-moduleregister")]
20#[doc(hidden)]
21#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
22mod __ModuleRegister_unity_raw {
23 use super::*;
24 #[doc(hidden)]
25 #[allow(non_snake_case)]
26 pub mod __lookup_register_core_modules {
27 use super::*;
28 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
29 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
30 <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
31 <crate::moon_sharp::interpreter::coremodules::CoreModules as ::unity::IlType>::il_type(),
32 ];
33 ::unity::lookup::method_info_on_class_with_signature(
34 <ModuleRegister as ::unity::ClassIdentity>::class(),
35 "RegisterCoreModules",
36 2,
37 param_types,
38 true,
39 )
40 });
41 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
42 match &*METHOD {
43 ::core::result::Result::Ok(mi) => *mi,
44 ::core::result::Result::Err(e) => {
45 panic!(
46 "method lookup failed: {}
47::{}
48: {}
49",
50 <ModuleRegister as ::unity::ClassIdentity>::NAME,
51 "RegisterCoreModules",
52 e
53 )
54 },
55 }
56 }
57 }
58 #[doc(hidden)]
59 #[allow(non_snake_case)]
60 pub mod __lookup_register_constants {
61 use super::*;
62 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
63 let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
64 &[<crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type()];
65 ::unity::lookup::method_info_on_class_with_signature(
66 <ModuleRegister as ::unity::ClassIdentity>::class(),
67 "RegisterConstants",
68 1,
69 param_types,
70 true,
71 )
72 });
73 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
74 match &*METHOD {
75 ::core::result::Result::Ok(mi) => *mi,
76 ::core::result::Result::Err(e) => {
77 panic!(
78 "method lookup failed: {}
79::{}
80: {}
81",
82 <ModuleRegister as ::unity::ClassIdentity>::NAME,
83 "RegisterConstants",
84 e
85 )
86 },
87 }
88 }
89 }
90 #[doc(hidden)]
91 #[allow(non_snake_case)]
92 pub mod __lookup_register_module_type {
93 use super::*;
94 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
95 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
96 <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
97 <::unity::SystemType as ::unity::IlType>::il_type(),
98 ];
99 ::unity::lookup::method_info_on_class_with_signature(
100 <ModuleRegister as ::unity::ClassIdentity>::class(),
101 "RegisterModuleType",
102 2,
103 param_types,
104 true,
105 )
106 });
107 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
108 match &*METHOD {
109 ::core::result::Result::Ok(mi) => *mi,
110 ::core::result::Result::Err(e) => {
111 panic!(
112 "method lookup failed: {}
113::{}
114: {}
115",
116 <ModuleRegister as ::unity::ClassIdentity>::NAME,
117 "RegisterModuleType",
118 e
119 )
120 },
121 }
122 }
123 }
124 #[doc(hidden)]
125 #[allow(non_snake_case)]
126 pub mod __lookup_register_script_field_as_const {
127 use super::*;
128 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
129 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
130 <crate::system::reflection::fieldinfo::FieldInfo as ::unity::IlType>::il_type(),
131 <crate::system::object::Object as ::unity::IlType>::il_type(),
132 <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
133 <::unity::SystemType as ::unity::IlType>::il_type(),
134 <::unity::Il2CppString as ::unity::IlType>::il_type(),
135 ];
136 ::unity::lookup::method_info_on_class_with_signature(
137 <ModuleRegister as ::unity::ClassIdentity>::class(),
138 "RegisterScriptFieldAsConst",
139 5,
140 param_types,
141 true,
142 )
143 });
144 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
145 match &*METHOD {
146 ::core::result::Result::Ok(mi) => *mi,
147 ::core::result::Result::Err(e) => {
148 panic!(
149 "method lookup failed: {}
150::{}
151: {}
152",
153 <ModuleRegister as ::unity::ClassIdentity>::NAME,
154 "RegisterScriptFieldAsConst",
155 e
156 )
157 },
158 }
159 }
160 }
161 #[doc(hidden)]
162 #[allow(non_snake_case)]
163 pub mod __lookup_register_script_field {
164 use super::*;
165 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
166 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
167 <crate::system::reflection::fieldinfo::FieldInfo as ::unity::IlType>::il_type(),
168 <crate::system::object::Object as ::unity::IlType>::il_type(),
169 <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
170 <::unity::SystemType as ::unity::IlType>::il_type(),
171 <::unity::Il2CppString as ::unity::IlType>::il_type(),
172 ];
173 ::unity::lookup::method_info_on_class_with_signature(
174 <ModuleRegister as ::unity::ClassIdentity>::class(),
175 "RegisterScriptField",
176 5,
177 param_types,
178 true,
179 )
180 });
181 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
182 match &*METHOD {
183 ::core::result::Result::Ok(mi) => *mi,
184 ::core::result::Result::Err(e) => {
185 panic!(
186 "method lookup failed: {}
187::{}
188: {}
189",
190 <ModuleRegister as ::unity::ClassIdentity>::NAME,
191 "RegisterScriptField",
192 e
193 )
194 },
195 }
196 }
197 }
198 #[doc(hidden)]
199 #[allow(non_snake_case)]
200 pub mod __lookup_create_module_namespace {
201 use super::*;
202 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
203 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
204 <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
205 <::unity::SystemType as ::unity::IlType>::il_type(),
206 ];
207 ::unity::lookup::method_info_on_class_with_signature(
208 <ModuleRegister as ::unity::ClassIdentity>::class(),
209 "CreateModuleNamespace",
210 2,
211 param_types,
212 true,
213 )
214 });
215 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
216 match &*METHOD {
217 ::core::result::Result::Ok(mi) => *mi,
218 ::core::result::Result::Err(e) => {
219 panic!(
220 "method lookup failed: {}
221::{}
222: {}
223",
224 <ModuleRegister as ::unity::ClassIdentity>::NAME,
225 "CreateModuleNamespace",
226 e
227 )
228 },
229 }
230 }
231 }
232}
233
234#[cfg(feature = "moon_sharp-interpreter-moduleregister")]
235impl ModuleRegister {
236 #[doc = "`RegisterCoreModules(crate::moon_sharp::interpreter::table::Table, crate::moon_sharp::interpreter::coremodules::CoreModules)` overload"]
237 pub fn register_core_modules(
238 table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
239 modules: impl ::core::convert::Into<crate::moon_sharp::interpreter::coremodules::CoreModules>,
240 ) -> crate::moon_sharp::interpreter::table::Table {
241 unsafe {
242 ::unity::il2cpp_call!(__ModuleRegister_unity_raw::__lookup_register_core_modules::get_method_info().method_ptr,crate::moon_sharp::interpreter::table::Table;
243(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table),(crate::moon_sharp::interpreter::coremodules::CoreModules)::core::convert::Into::into(modules))
244 }
245 }
246
247 #[doc = "`RegisterConstants(crate::moon_sharp::interpreter::table::Table)` overload"]
248 pub fn register_constants(
249 table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
250 ) -> crate::moon_sharp::interpreter::table::Table {
251 unsafe {
252 ::unity::il2cpp_call!(__ModuleRegister_unity_raw::__lookup_register_constants::get_method_info().method_ptr,crate::moon_sharp::interpreter::table::Table;
253(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table))
254 }
255 }
256
257 #[doc = "`RegisterModuleType(crate::moon_sharp::interpreter::table::Table, ::unity::SystemType)` overload"]
258 pub fn register_module_type(
259 gtable: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
260 t: impl ::core::convert::Into<::unity::SystemType>,
261 ) -> crate::moon_sharp::interpreter::table::Table {
262 unsafe {
263 ::unity::il2cpp_call!(__ModuleRegister_unity_raw::__lookup_register_module_type::get_method_info().method_ptr,crate::moon_sharp::interpreter::table::Table;
264(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(gtable),(::unity::SystemType)::core::convert::Into::into(t))
265 }
266 }
267
268 #[doc = "`RegisterScriptFieldAsConst(crate::system::reflection::fieldinfo::FieldInfo, crate::system::object::Object, crate::moon_sharp::interpreter::table::Table, ::unity::SystemType, ::unity::Il2CppString)` overload"]
269 pub fn register_script_field_as_const(
270 fi: impl ::core::convert::Into<crate::system::reflection::fieldinfo::FieldInfo>,
271 o: impl ::core::convert::Into<crate::system::object::Object>,
272 table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
273 t: impl ::core::convert::Into<::unity::SystemType>,
274 name: impl ::core::convert::Into<::unity::Il2CppString>,
275 ) -> () {
276 unsafe {
277 ::unity::il2cpp_call!(__ModuleRegister_unity_raw::__lookup_register_script_field_as_const::get_method_info().method_ptr,();
278(crate::system::reflection::fieldinfo::FieldInfo)::core::convert::Into::into(fi),(crate::system::object::Object)::core::convert::Into::into(o),(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table),(::unity::SystemType)::core::convert::Into::into(t),(::unity::Il2CppString)::core::convert::Into::into(name))
279 }
280 }
281
282 #[doc = "`RegisterScriptField(crate::system::reflection::fieldinfo::FieldInfo, crate::system::object::Object, crate::moon_sharp::interpreter::table::Table, ::unity::SystemType, ::unity::Il2CppString)` overload"]
283 pub fn register_script_field(
284 fi: impl ::core::convert::Into<crate::system::reflection::fieldinfo::FieldInfo>,
285 o: impl ::core::convert::Into<crate::system::object::Object>,
286 table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
287 t: impl ::core::convert::Into<::unity::SystemType>,
288 name: impl ::core::convert::Into<::unity::Il2CppString>,
289 ) -> () {
290 unsafe {
291 ::unity::il2cpp_call!(__ModuleRegister_unity_raw::__lookup_register_script_field::get_method_info().method_ptr,();
292(crate::system::reflection::fieldinfo::FieldInfo)::core::convert::Into::into(fi),(crate::system::object::Object)::core::convert::Into::into(o),(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table),(::unity::SystemType)::core::convert::Into::into(t),(::unity::Il2CppString)::core::convert::Into::into(name))
293 }
294 }
295
296 #[doc = "`CreateModuleNamespace(crate::moon_sharp::interpreter::table::Table, ::unity::SystemType)` overload"]
297 pub fn create_module_namespace(
298 gtable: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
299 t: impl ::core::convert::Into<::unity::SystemType>,
300 ) -> crate::moon_sharp::interpreter::table::Table {
301 unsafe {
302 ::unity::il2cpp_call!(__ModuleRegister_unity_raw::__lookup_create_module_namespace::get_method_info().method_ptr,crate::moon_sharp::interpreter::table::Table;
303(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(gtable),(::unity::SystemType)::core::convert::Into::into(t))
304 }
305 }
306
307 pub fn register_module_type_2<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
308 table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
309 ) -> crate::moon_sharp::interpreter::table::Table {
310 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
311 ::unity::lookup::method_info_on_class(<ModuleRegister as ::unity::ClassIdentity>::class(), "RegisterModuleType", 1)
312 });
313 #[allow(clippy::type_complexity)]
314 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
315 ::std::sync::OnceLock::new();
316 let _ = true;
317 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
318 ::core::result::Result::Ok(mi) => *mi,
319 ::core::result::Result::Err(e) => {
320 panic!(
321 "method lookup failed: {}
322::{}
323: {}
324",
325 <ModuleRegister as ::unity::ClassIdentity>::NAME,
326 "RegisterModuleType",
327 e
328 )
329 },
330 };
331 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
332 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
333 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
334 let mut __guard = __cache.lock().unwrap();
335 *__guard
336 .entry(__key)
337 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
338 };
339 unsafe {
340 let __f: extern "C" fn(
341 crate::moon_sharp::interpreter::table::Table,
342 ::unity::OptionalMethod,
343 ) -> crate::moon_sharp::interpreter::table::Table = ::core::mem::transmute(__inflated.method_ptr);
344 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
345 __f(::core::convert::Into::into(table), ::core::option::Option::Some(__mi_opaque))
346 }
347 }
348}
349
350#[cfg(feature = "moon_sharp-interpreter-moduleregister")]
351impl ModuleRegister {
352 pub fn register_core_modules_method_info() -> &'static ::unity::il2cpp::MethodInfo {
353 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
354 }
355
356 pub fn register_constants_method_info() -> &'static ::unity::il2cpp::MethodInfo {
357 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
358 }
359
360 pub fn register_module_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
361 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
362 }
363
364 pub fn register_script_field_as_const_method_info() -> &'static ::unity::il2cpp::MethodInfo {
365 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
366 }
367
368 pub fn register_script_field_method_info() -> &'static ::unity::il2cpp::MethodInfo {
369 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
370 }
371
372 pub fn create_module_namespace_method_info() -> &'static ::unity::il2cpp::MethodInfo {
373 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
374 }
375}
376
377#[cfg(feature = "moon_sharp-interpreter-moduleregister")]
378#[doc(hidden)]
379pub mod prelude {
380 pub use super::{IModuleRegister, ModuleRegister};
381 pub use crate::system::object::IObject;
382 #[cfg(feature = "system-object")]
383 pub use crate::system::object::IObjectMethods;
384}