Skip to main content

engage/generated/system/collections/generic/
enumerablehelpers.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "system-collections-generic-enumerablehelpers-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/system/collections/generic/enumerablehelpers/EnumerableHelpers.md"))]
11    #[::unity::class(namespace = "System.Collections.Generic", name = "EnumerableHelpers")]
12    #[parent(crate::system::object::Object)]
13    pub struct EnumerableHelpers {}
14}
15
16#[cfg(feature = "system-collections-generic-enumerablehelpers-types")]
17pub use __types::*;
18
19#[cfg(feature = "system-collections-generic-enumerablehelpers")]
20impl EnumerableHelpers {
21    pub fn to_array<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
22        source: impl ::core::convert::Into<crate::system::collections::generic::ienumerable_1::IEnumerable_1<M0>>,
23        length: impl ::core::convert::Into<*mut i32>,
24    ) -> ::unity::Array<M0> {
25        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
26            ::unity::lookup::method_info_on_class(<EnumerableHelpers as ::unity::ClassIdentity>::class(), "ToArray", 2)
27        });
28        #[allow(clippy::type_complexity)]
29        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
30            ::std::sync::OnceLock::new();
31        let _ = true;
32        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
33            ::core::result::Result::Ok(mi) => *mi,
34            ::core::result::Result::Err(e) => {
35                panic!(
36                    "method lookup failed: {}
37::{}
38: {}
39",
40                    <EnumerableHelpers as ::unity::ClassIdentity>::NAME,
41                    "ToArray",
42                    e
43                )
44            },
45        };
46        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
47        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
48        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
49            let mut __guard = __cache.lock().unwrap();
50            *__guard
51                .entry(__key)
52                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
53        };
54        unsafe {
55            let __f: extern "C" fn(
56                crate::system::collections::generic::ienumerable_1::IEnumerable_1<M0>,
57                *mut i32,
58                ::unity::OptionalMethod,
59            ) -> ::unity::Array<M0> = ::core::mem::transmute(__inflated.method_ptr);
60            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
61            __f(
62                ::core::convert::Into::into(source),
63                ::core::convert::Into::into(length),
64                ::core::option::Option::Some(__mi_opaque),
65            )
66        }
67    }
68}
69
70#[cfg(feature = "system-collections-generic-enumerablehelpers")]
71#[doc(hidden)]
72pub mod prelude {
73    pub use super::{EnumerableHelpers, IEnumerableHelpers};
74    pub use crate::system::object::IObject;
75    #[cfg(feature = "system-object")]
76    pub use crate::system::object::IObjectMethods;
77}