engage/generated/moon_sharp/interpreter/
linqhelpers.rs1#[cfg(feature = "moon_sharp-interpreter-linqhelpers-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/linqhelpers/LinqHelpers.md"))]
11 #[::unity::class(namespace = "MoonSharp.Interpreter", name = "LinqHelpers")]
12 #[parent(crate::system::object::Object)]
13 pub struct LinqHelpers {}
14}
15
16#[cfg(feature = "moon_sharp-interpreter-linqhelpers-types")]
17pub use __types::*;
18
19#[cfg(feature = "moon_sharp-interpreter-linqhelpers")]
20#[doc(hidden)]
21#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
22mod __LinqHelpers_unity_raw {
23 use super::*;
24 #[doc(hidden)]
25 #[allow(non_snake_case)]
26 pub mod __lookup_of_data_type {
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]= &[<crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>as::unity::IlType> ::il_type(), <crate::moon_sharp::interpreter::datatype::DataType as::unity::IlType> ::il_type()];
30 ::unity::lookup::method_info_on_class_with_signature(<LinqHelpers as ::unity::ClassIdentity>::class(), "OfDataType", 2, param_types, true)
31 });
32 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
33 match &*METHOD {
34 ::core::result::Result::Ok(mi) => *mi,
35 ::core::result::Result::Err(e) => {
36 panic!(
37 "method lookup failed: {}
38::{}
39: {}
40",
41 <LinqHelpers as ::unity::ClassIdentity>::NAME,
42 "OfDataType",
43 e
44 )
45 },
46 }
47 }
48 }
49 #[doc(hidden)]
50 #[allow(non_snake_case)]
51 pub mod __lookup_as_objects {
52 use super::*;
53 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
54 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[<crate::system::collections::generic::ienumerable_1::IEnumerable_1<
55 crate::moon_sharp::interpreter::dynvalue::DynValue,
56 > as ::unity::IlType>::il_type()];
57 ::unity::lookup::method_info_on_class_with_signature(<LinqHelpers as ::unity::ClassIdentity>::class(), "AsObjects", 1, param_types, true)
58 });
59 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
60 match &*METHOD {
61 ::core::result::Result::Ok(mi) => *mi,
62 ::core::result::Result::Err(e) => {
63 panic!(
64 "method lookup failed: {}
65::{}
66: {}
67",
68 <LinqHelpers as ::unity::ClassIdentity>::NAME,
69 "AsObjects",
70 e
71 )
72 },
73 }
74 }
75 }
76}
77
78#[cfg(feature = "moon_sharp-interpreter-linqhelpers")]
79impl LinqHelpers {
80 pub fn convert<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
81 enumerable: impl ::core::convert::Into<
82 crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>,
83 >,
84 r#type: impl ::core::convert::Into<crate::moon_sharp::interpreter::datatype::DataType>,
85 ) -> crate::system::collections::generic::ienumerable_1::IEnumerable_1<M0> {
86 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> =
87 ::std::sync::LazyLock::new(|| ::unity::lookup::method_info_on_class(<LinqHelpers as ::unity::ClassIdentity>::class(), "Convert", 2));
88 #[allow(clippy::type_complexity)]
89 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
90 ::std::sync::OnceLock::new();
91 let _ = true;
92 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
93 ::core::result::Result::Ok(mi) => *mi,
94 ::core::result::Result::Err(e) => {
95 panic!(
96 "method lookup failed: {}
97::{}
98: {}
99",
100 <LinqHelpers as ::unity::ClassIdentity>::NAME,
101 "Convert",
102 e
103 )
104 },
105 };
106 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
107 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
108 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
109 let mut __guard = __cache.lock().unwrap();
110 *__guard
111 .entry(__key)
112 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
113 };
114 unsafe {
115 let __f: extern "C" fn(
116 crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>,
117 crate::moon_sharp::interpreter::datatype::DataType,
118 ::unity::OptionalMethod,
119 ) -> crate::system::collections::generic::ienumerable_1::IEnumerable_1<M0> = ::core::mem::transmute(__inflated.method_ptr);
120 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
121 __f(
122 ::core::convert::Into::into(enumerable),
123 ::core::convert::Into::into(r#type),
124 ::core::option::Option::Some(__mi_opaque),
125 )
126 }
127 }
128
129 #[doc = "`OfDataType(crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>, crate::moon_sharp::interpreter::datatype::DataType)` overload"]
130 pub fn of_data_type(
131 enumerable: impl ::core::convert::Into<
132 crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>,
133 >,
134 r#type: impl ::core::convert::Into<crate::moon_sharp::interpreter::datatype::DataType>,
135 ) -> crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue> {
136 unsafe {
137 ::unity::il2cpp_call!(__LinqHelpers_unity_raw::__lookup_of_data_type::get_method_info().method_ptr,crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue> ;
138(crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>)::core::convert::Into::into(enumerable),(crate::moon_sharp::interpreter::datatype::DataType)::core::convert::Into::into(r#type))
139 }
140 }
141
142 #[doc = "`AsObjects(crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>)` overload"]
143 pub fn as_objects(
144 enumerable: impl ::core::convert::Into<
145 crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>,
146 >,
147 ) -> crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::system::object::Object> {
148 unsafe {
149 ::unity::il2cpp_call!(__LinqHelpers_unity_raw::__lookup_as_objects::get_method_info().method_ptr,crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::system::object::Object> ;
150(crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::moon_sharp::interpreter::dynvalue::DynValue>)::core::convert::Into::into(enumerable))
151 }
152 }
153}
154
155#[cfg(feature = "moon_sharp-interpreter-linqhelpers")]
156impl LinqHelpers {
157 pub fn of_data_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
158 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
159 }
160
161 pub fn as_objects_method_info() -> &'static ::unity::il2cpp::MethodInfo {
162 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
163 }
164}
165
166#[cfg(feature = "moon_sharp-interpreter-linqhelpers")]
167#[doc(hidden)]
168pub mod prelude {
169 pub use super::{ILinqHelpers, LinqHelpers};
170 pub use crate::system::object::IObject;
171 #[cfg(feature = "system-object")]
172 pub use crate::system::object::IObjectMethods;
173}