Skip to main content

engage/generated/moon_sharp/interpreter/interop/converters/
tableconversions.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "moon_sharp-interpreter-interop-converters-tableconversions-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/interop/converters/tableconversions/TableConversions.md"))]
11    #[::unity::class(namespace = "MoonSharp.Interpreter.Interop.Converters", name = "TableConversions")]
12    #[parent(crate::system::object::Object)]
13    pub struct TableConversions {}
14}
15
16#[cfg(feature = "moon_sharp-interpreter-interop-converters-tableconversions-types")]
17pub use __types::*;
18
19#[cfg(feature = "moon_sharp-interpreter-interop-converters-tableconversions")]
20#[doc(hidden)]
21#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
22mod __TableConversions_unity_raw {
23    use super::*;
24    #[doc(hidden)]
25    #[allow(non_snake_case)]
26    pub mod __lookup_convert_i_list_to_table {
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::script::Script as ::unity::IlType>::il_type(),
31                <crate::system::collections::ilist::IList as ::unity::IlType>::il_type(),
32            ];
33            ::unity::lookup::method_info_on_class_with_signature(
34                <TableConversions as ::unity::ClassIdentity>::class(),
35                "ConvertIListToTable",
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                        <TableConversions as ::unity::ClassIdentity>::NAME,
51                        "ConvertIListToTable",
52                        e
53                    )
54                },
55            }
56        }
57    }
58    #[doc(hidden)]
59    #[allow(non_snake_case)]
60    pub mod __lookup_convert_i_dictionary_to_table {
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::script::Script as ::unity::IlType>::il_type(),
65                <crate::system::collections::idictionary::IDictionary as ::unity::IlType>::il_type(),
66            ];
67            ::unity::lookup::method_info_on_class_with_signature(
68                <TableConversions as ::unity::ClassIdentity>::class(),
69                "ConvertIDictionaryToTable",
70                2,
71                param_types,
72                true,
73            )
74        });
75        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
76            match &*METHOD {
77                ::core::result::Result::Ok(mi) => *mi,
78                ::core::result::Result::Err(e) => {
79                    panic!(
80                        "method lookup failed: {}
81::{}
82: {}
83",
84                        <TableConversions as ::unity::ClassIdentity>::NAME,
85                        "ConvertIDictionaryToTable",
86                        e
87                    )
88                },
89            }
90        }
91    }
92    #[doc(hidden)]
93    #[allow(non_snake_case)]
94    pub mod __lookup_can_convert_table_to_type {
95        use super::*;
96        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
97            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
98                <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
99                <::unity::SystemType as ::unity::IlType>::il_type(),
100            ];
101            ::unity::lookup::method_info_on_class_with_signature(
102                <TableConversions as ::unity::ClassIdentity>::class(),
103                "CanConvertTableToType",
104                2,
105                param_types,
106                true,
107            )
108        });
109        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
110            match &*METHOD {
111                ::core::result::Result::Ok(mi) => *mi,
112                ::core::result::Result::Err(e) => {
113                    panic!(
114                        "method lookup failed: {}
115::{}
116: {}
117",
118                        <TableConversions as ::unity::ClassIdentity>::NAME,
119                        "CanConvertTableToType",
120                        e
121                    )
122                },
123            }
124        }
125    }
126    #[doc(hidden)]
127    #[allow(non_snake_case)]
128    pub mod __lookup_convert_table_to_type {
129        use super::*;
130        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
131            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
132                <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
133                <::unity::SystemType as ::unity::IlType>::il_type(),
134            ];
135            ::unity::lookup::method_info_on_class_with_signature(
136                <TableConversions as ::unity::ClassIdentity>::class(),
137                "ConvertTableToType",
138                2,
139                param_types,
140                true,
141            )
142        });
143        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
144            match &*METHOD {
145                ::core::result::Result::Ok(mi) => *mi,
146                ::core::result::Result::Err(e) => {
147                    panic!(
148                        "method lookup failed: {}
149::{}
150: {}
151",
152                        <TableConversions as ::unity::ClassIdentity>::NAME,
153                        "ConvertTableToType",
154                        e
155                    )
156                },
157            }
158        }
159    }
160    #[doc(hidden)]
161    #[allow(non_snake_case)]
162    pub mod __lookup_convert_table_to_dictionary_of_generic_type {
163        use super::*;
164        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
165            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
166                <::unity::SystemType as ::unity::IlType>::il_type(),
167                <::unity::SystemType as ::unity::IlType>::il_type(),
168                <::unity::SystemType as ::unity::IlType>::il_type(),
169                <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
170            ];
171            ::unity::lookup::method_info_on_class_with_signature(
172                <TableConversions as ::unity::ClassIdentity>::class(),
173                "ConvertTableToDictionaryOfGenericType",
174                4,
175                param_types,
176                true,
177            )
178        });
179        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
180            match &*METHOD {
181                ::core::result::Result::Ok(mi) => *mi,
182                ::core::result::Result::Err(e) => {
183                    panic!(
184                        "method lookup failed: {}
185::{}
186: {}
187",
188                        <TableConversions as ::unity::ClassIdentity>::NAME,
189                        "ConvertTableToDictionaryOfGenericType",
190                        e
191                    )
192                },
193            }
194        }
195    }
196    #[doc(hidden)]
197    #[allow(non_snake_case)]
198    pub mod __lookup_convert_table_to_array_of_generic_type {
199        use super::*;
200        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
201            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
202                <::unity::SystemType as ::unity::IlType>::il_type(),
203                <::unity::SystemType as ::unity::IlType>::il_type(),
204                <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
205            ];
206            ::unity::lookup::method_info_on_class_with_signature(
207                <TableConversions as ::unity::ClassIdentity>::class(),
208                "ConvertTableToArrayOfGenericType",
209                3,
210                param_types,
211                true,
212            )
213        });
214        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
215            match &*METHOD {
216                ::core::result::Result::Ok(mi) => *mi,
217                ::core::result::Result::Err(e) => {
218                    panic!(
219                        "method lookup failed: {}
220::{}
221: {}
222",
223                        <TableConversions as ::unity::ClassIdentity>::NAME,
224                        "ConvertTableToArrayOfGenericType",
225                        e
226                    )
227                },
228            }
229        }
230    }
231    #[doc(hidden)]
232    #[allow(non_snake_case)]
233    pub mod __lookup_convert_table_to_list_of_generic_type {
234        use super::*;
235        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
236            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
237                <::unity::SystemType as ::unity::IlType>::il_type(),
238                <::unity::SystemType as ::unity::IlType>::il_type(),
239                <crate::moon_sharp::interpreter::table::Table as ::unity::IlType>::il_type(),
240            ];
241            ::unity::lookup::method_info_on_class_with_signature(
242                <TableConversions as ::unity::ClassIdentity>::class(),
243                "ConvertTableToListOfGenericType",
244                3,
245                param_types,
246                true,
247            )
248        });
249        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
250            match &*METHOD {
251                ::core::result::Result::Ok(mi) => *mi,
252                ::core::result::Result::Err(e) => {
253                    panic!(
254                        "method lookup failed: {}
255::{}
256: {}
257",
258                        <TableConversions as ::unity::ClassIdentity>::NAME,
259                        "ConvertTableToListOfGenericType",
260                        e
261                    )
262                },
263            }
264        }
265    }
266}
267
268#[cfg(feature = "moon_sharp-interpreter-interop-converters-tableconversions")]
269impl TableConversions {
270    #[doc = "`ConvertIListToTable(crate::moon_sharp::interpreter::script::Script, crate::system::collections::ilist::IList)` overload"]
271    pub fn convert_i_list_to_table(
272        script: impl ::core::convert::Into<crate::moon_sharp::interpreter::script::Script>,
273        list: impl ::core::convert::Into<crate::system::collections::ilist::IList>,
274    ) -> crate::moon_sharp::interpreter::table::Table {
275        unsafe {
276            ::unity::il2cpp_call!(__TableConversions_unity_raw::__lookup_convert_i_list_to_table::get_method_info().method_ptr,crate::moon_sharp::interpreter::table::Table;
277(crate::moon_sharp::interpreter::script::Script)::core::convert::Into::into(script),(crate::system::collections::ilist::IList)::core::convert::Into::into(list))
278        }
279    }
280
281    #[doc = "`ConvertIDictionaryToTable(crate::moon_sharp::interpreter::script::Script, crate::system::collections::idictionary::IDictionary)` overload"]
282    pub fn convert_i_dictionary_to_table(
283        script: impl ::core::convert::Into<crate::moon_sharp::interpreter::script::Script>,
284        dict: impl ::core::convert::Into<crate::system::collections::idictionary::IDictionary>,
285    ) -> crate::moon_sharp::interpreter::table::Table {
286        unsafe {
287            ::unity::il2cpp_call!(__TableConversions_unity_raw::__lookup_convert_i_dictionary_to_table::get_method_info().method_ptr,crate::moon_sharp::interpreter::table::Table;
288(crate::moon_sharp::interpreter::script::Script)::core::convert::Into::into(script),(crate::system::collections::idictionary::IDictionary)::core::convert::Into::into(dict))
289        }
290    }
291
292    #[doc = "`CanConvertTableToType(crate::moon_sharp::interpreter::table::Table, ::unity::SystemType)` overload"]
293    pub fn can_convert_table_to_type(
294        table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
295        t: impl ::core::convert::Into<::unity::SystemType>,
296    ) -> bool {
297        unsafe {
298            ::unity::il2cpp_call!(__TableConversions_unity_raw::__lookup_can_convert_table_to_type::get_method_info().method_ptr,bool;
299(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table),(::unity::SystemType)::core::convert::Into::into(t))
300        }
301    }
302
303    #[doc = "`ConvertTableToType(crate::moon_sharp::interpreter::table::Table, ::unity::SystemType)` overload"]
304    pub fn convert_table_to_type(
305        table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
306        t: impl ::core::convert::Into<::unity::SystemType>,
307    ) -> crate::system::object::Object {
308        unsafe {
309            ::unity::il2cpp_call!(__TableConversions_unity_raw::__lookup_convert_table_to_type::get_method_info().method_ptr,crate::system::object::Object;
310(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table),(::unity::SystemType)::core::convert::Into::into(t))
311        }
312    }
313
314    #[doc = "`ConvertTableToDictionaryOfGenericType(::unity::SystemType, ::unity::SystemType, ::unity::SystemType, crate::moon_sharp::interpreter::table::Table)` overload"]
315    pub fn convert_table_to_dictionary_of_generic_type(
316        dictionary_type: impl ::core::convert::Into<::unity::SystemType>,
317        key_type: impl ::core::convert::Into<::unity::SystemType>,
318        value_type: impl ::core::convert::Into<::unity::SystemType>,
319        table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
320    ) -> crate::system::object::Object {
321        unsafe {
322            ::unity::il2cpp_call!(__TableConversions_unity_raw::__lookup_convert_table_to_dictionary_of_generic_type::get_method_info().method_ptr,crate::system::object::Object;
323(::unity::SystemType)::core::convert::Into::into(dictionary_type),(::unity::SystemType)::core::convert::Into::into(key_type),(::unity::SystemType)::core::convert::Into::into(value_type),(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table))
324        }
325    }
326
327    #[doc = "`ConvertTableToArrayOfGenericType(::unity::SystemType, ::unity::SystemType, crate::moon_sharp::interpreter::table::Table)` overload"]
328    pub fn convert_table_to_array_of_generic_type(
329        array_type: impl ::core::convert::Into<::unity::SystemType>,
330        item_type: impl ::core::convert::Into<::unity::SystemType>,
331        table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
332    ) -> crate::system::object::Object {
333        unsafe {
334            ::unity::il2cpp_call!(__TableConversions_unity_raw::__lookup_convert_table_to_array_of_generic_type::get_method_info().method_ptr,crate::system::object::Object;
335(::unity::SystemType)::core::convert::Into::into(array_type),(::unity::SystemType)::core::convert::Into::into(item_type),(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table))
336        }
337    }
338
339    #[doc = "`ConvertTableToListOfGenericType(::unity::SystemType, ::unity::SystemType, crate::moon_sharp::interpreter::table::Table)` overload"]
340    pub fn convert_table_to_list_of_generic_type(
341        list_type: impl ::core::convert::Into<::unity::SystemType>,
342        item_type: impl ::core::convert::Into<::unity::SystemType>,
343        table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
344    ) -> crate::system::object::Object {
345        unsafe {
346            ::unity::il2cpp_call!(__TableConversions_unity_raw::__lookup_convert_table_to_list_of_generic_type::get_method_info().method_ptr,crate::system::object::Object;
347(::unity::SystemType)::core::convert::Into::into(list_type),(::unity::SystemType)::core::convert::Into::into(item_type),(crate::moon_sharp::interpreter::table::Table)::core::convert::Into::into(table))
348        }
349    }
350
351    pub fn table_to_list<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
352        table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
353        converter: impl ::core::convert::Into<crate::system::func_2::Func_2<crate::moon_sharp::interpreter::dynvalue::DynValue, M0>>,
354    ) -> crate::system::collections::generic::list_1::List_1<M0> {
355        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
356            ::unity::lookup::method_info_on_class(<TableConversions as ::unity::ClassIdentity>::class(), "TableToList", 2)
357        });
358        #[allow(clippy::type_complexity)]
359        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
360            ::std::sync::OnceLock::new();
361        let _ = true;
362        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
363            ::core::result::Result::Ok(mi) => *mi,
364            ::core::result::Result::Err(e) => {
365                panic!(
366                    "method lookup failed: {}
367::{}
368: {}
369",
370                    <TableConversions as ::unity::ClassIdentity>::NAME,
371                    "TableToList",
372                    e
373                )
374            },
375        };
376        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
377        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
378        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
379            let mut __guard = __cache.lock().unwrap();
380            *__guard
381                .entry(__key)
382                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
383        };
384        unsafe {
385            let __f: extern "C" fn(
386                crate::moon_sharp::interpreter::table::Table,
387                crate::system::func_2::Func_2<crate::moon_sharp::interpreter::dynvalue::DynValue, M0>,
388                ::unity::OptionalMethod,
389            ) -> crate::system::collections::generic::list_1::List_1<M0> = ::core::mem::transmute(__inflated.method_ptr);
390            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
391            __f(
392                ::core::convert::Into::into(table),
393                ::core::convert::Into::into(converter),
394                ::core::option::Option::Some(__mi_opaque),
395            )
396        }
397    }
398
399    pub fn table_to_dictionary<
400        M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity,
401        M1: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity,
402    >(
403        table: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
404        keyconverter: impl ::core::convert::Into<crate::system::func_2::Func_2<crate::moon_sharp::interpreter::dynvalue::DynValue, M0>>,
405        valconverter: impl ::core::convert::Into<crate::system::func_2::Func_2<crate::moon_sharp::interpreter::dynvalue::DynValue, M1>>,
406    ) -> crate::system::collections::generic::dictionary_2::Dictionary_2<M0, M1> {
407        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
408            ::unity::lookup::method_info_on_class(<TableConversions as ::unity::ClassIdentity>::class(), "TableToDictionary", 3)
409        });
410        #[allow(clippy::type_complexity)]
411        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
412            ::std::sync::OnceLock::new();
413        let _ = true;
414        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
415            ::core::result::Result::Ok(mi) => *mi,
416            ::core::result::Result::Err(e) => {
417                panic!(
418                    "method lookup failed: {}
419::{}
420: {}
421",
422                    <TableConversions as ::unity::ClassIdentity>::NAME,
423                    "TableToDictionary",
424                    e
425                )
426            },
427        };
428        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
429        let __key: usize = (<M0 as ::unity::IlType>::il_type() as *const _ as usize) ^ (<M1 as ::unity::IlType>::il_type() as *const _ as usize);
430        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
431            let mut __guard = __cache.lock().unwrap();
432            *__guard.entry(__key).or_insert_with(|| {
433                ::unity::il2cpp::generic::create_generic_method_info(__open, &[
434                    <M0 as ::unity::IlType>::il_type(),
435                    <M1 as ::unity::IlType>::il_type(),
436                ])
437            })
438        };
439        unsafe {
440            let __f: extern "C" fn(
441                crate::moon_sharp::interpreter::table::Table,
442                crate::system::func_2::Func_2<crate::moon_sharp::interpreter::dynvalue::DynValue, M0>,
443                crate::system::func_2::Func_2<crate::moon_sharp::interpreter::dynvalue::DynValue, M1>,
444                ::unity::OptionalMethod,
445            ) -> crate::system::collections::generic::dictionary_2::Dictionary_2<M0, M1> = ::core::mem::transmute(__inflated.method_ptr);
446            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
447            __f(
448                ::core::convert::Into::into(table),
449                ::core::convert::Into::into(keyconverter),
450                ::core::convert::Into::into(valconverter),
451                ::core::option::Option::Some(__mi_opaque),
452            )
453        }
454    }
455}
456
457#[cfg(feature = "moon_sharp-interpreter-interop-converters-tableconversions")]
458impl TableConversions {
459    pub fn convert_i_list_to_table_method_info() -> &'static ::unity::il2cpp::MethodInfo {
460        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
461    }
462
463    pub fn convert_i_dictionary_to_table_method_info() -> &'static ::unity::il2cpp::MethodInfo {
464        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
465    }
466
467    pub fn can_convert_table_to_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
468        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
469    }
470
471    pub fn convert_table_to_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
472        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
473    }
474
475    pub fn convert_table_to_dictionary_of_generic_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
476        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
477    }
478
479    pub fn convert_table_to_array_of_generic_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
480        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
481    }
482
483    pub fn convert_table_to_list_of_generic_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
484        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
485    }
486}
487
488#[cfg(feature = "moon_sharp-interpreter-interop-converters-tableconversions")]
489#[doc(hidden)]
490pub mod prelude {
491    pub use super::{ITableConversions, TableConversions};
492    pub use crate::system::object::IObject;
493    #[cfg(feature = "system-object")]
494    pub use crate::system::object::IObjectMethods;
495}