Skip to main content

engage/generated/unity_engine/
noallochelpers.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-noallochelpers-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/unity_engine/noallochelpers/NoAllocHelpers.md"))]
11    #[::unity::class(namespace = "UnityEngine", name = "NoAllocHelpers")]
12    #[parent(crate::system::object::Object)]
13    pub struct NoAllocHelpers {}
14}
15
16#[cfg(feature = "unity_engine-noallochelpers-types")]
17pub use __types::*;
18
19#[cfg(feature = "unity_engine-noallochelpers")]
20impl NoAllocHelpers {
21    pub fn resize_list<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
22        list: impl ::core::convert::Into<crate::system::collections::generic::list_1::List_1<M0>>,
23        size: impl ::core::convert::Into<i32>,
24    ) -> () {
25        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
26            ::unity::lookup::method_info_on_class(<NoAllocHelpers as ::unity::ClassIdentity>::class(), "ResizeList", 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                    <NoAllocHelpers as ::unity::ClassIdentity>::NAME,
41                    "ResizeList",
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(crate::system::collections::generic::list_1::List_1<M0>, i32, ::unity::OptionalMethod) -> () =
56                ::core::mem::transmute(__inflated.method_ptr);
57            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
58            __f(
59                ::core::convert::Into::into(list),
60                ::core::convert::Into::into(size),
61                ::core::option::Option::Some(__mi_opaque),
62            )
63        }
64    }
65
66    pub fn ensure_list_elem_count<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
67        list: impl ::core::convert::Into<crate::system::collections::generic::list_1::List_1<M0>>,
68        count: impl ::core::convert::Into<i32>,
69    ) -> () {
70        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
71            ::unity::lookup::method_info_on_class(<NoAllocHelpers as ::unity::ClassIdentity>::class(), "EnsureListElemCount", 2)
72        });
73        #[allow(clippy::type_complexity)]
74        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
75            ::std::sync::OnceLock::new();
76        let _ = true;
77        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
78            ::core::result::Result::Ok(mi) => *mi,
79            ::core::result::Result::Err(e) => {
80                panic!(
81                    "method lookup failed: {}
82::{}
83: {}
84",
85                    <NoAllocHelpers as ::unity::ClassIdentity>::NAME,
86                    "EnsureListElemCount",
87                    e
88                )
89            },
90        };
91        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
92        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
93        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
94            let mut __guard = __cache.lock().unwrap();
95            *__guard
96                .entry(__key)
97                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
98        };
99        unsafe {
100            let __f: extern "C" fn(crate::system::collections::generic::list_1::List_1<M0>, i32, ::unity::OptionalMethod) -> () =
101                ::core::mem::transmute(__inflated.method_ptr);
102            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
103            __f(
104                ::core::convert::Into::into(list),
105                ::core::convert::Into::into(count),
106                ::core::option::Option::Some(__mi_opaque),
107            )
108        }
109    }
110
111    #[doc = "`SafeLength(::unity::IlInstance)` overload"]
112    pub fn safe_length(values: impl ::core::convert::Into<::unity::IlInstance>) -> i32 {
113        unsafe {
114            ::unity::il2cpp_call!((::unity::module_base()+0x32e6650usize)as*mut u8,i32;
115(::unity::IlInstance)::core::convert::Into::into(values))
116        }
117    }
118
119    pub fn safe_length_2<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
120        values: impl ::core::convert::Into<crate::system::collections::generic::list_1::List_1<M0>>,
121    ) -> i32 {
122        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
123            ::unity::lookup::method_info_on_class(<NoAllocHelpers as ::unity::ClassIdentity>::class(), "SafeLength", 1)
124        });
125        #[allow(clippy::type_complexity)]
126        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
127            ::std::sync::OnceLock::new();
128        let _ = true;
129        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
130            ::core::result::Result::Ok(mi) => *mi,
131            ::core::result::Result::Err(e) => {
132                panic!(
133                    "method lookup failed: {}
134::{}
135: {}
136",
137                    <NoAllocHelpers as ::unity::ClassIdentity>::NAME,
138                    "SafeLength",
139                    e
140                )
141            },
142        };
143        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
144        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
145        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
146            let mut __guard = __cache.lock().unwrap();
147            *__guard
148                .entry(__key)
149                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
150        };
151        unsafe {
152            let __f: extern "C" fn(crate::system::collections::generic::list_1::List_1<M0>, ::unity::OptionalMethod) -> i32 =
153                ::core::mem::transmute(__inflated.method_ptr);
154            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
155            __f(::core::convert::Into::into(values), ::core::option::Option::Some(__mi_opaque))
156        }
157    }
158
159    pub fn extract_array_from_list_t<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
160        list: impl ::core::convert::Into<crate::system::collections::generic::list_1::List_1<M0>>,
161    ) -> ::unity::Array<M0> {
162        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
163            ::unity::lookup::method_info_on_class(<NoAllocHelpers as ::unity::ClassIdentity>::class(), "ExtractArrayFromListT", 1)
164        });
165        #[allow(clippy::type_complexity)]
166        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
167            ::std::sync::OnceLock::new();
168        let _ = true;
169        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
170            ::core::result::Result::Ok(mi) => *mi,
171            ::core::result::Result::Err(e) => {
172                panic!(
173                    "method lookup failed: {}
174::{}
175: {}
176",
177                    <NoAllocHelpers as ::unity::ClassIdentity>::NAME,
178                    "ExtractArrayFromListT",
179                    e
180                )
181            },
182        };
183        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
184        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
185        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
186            let mut __guard = __cache.lock().unwrap();
187            *__guard
188                .entry(__key)
189                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
190        };
191        unsafe {
192            let __f: extern "C" fn(crate::system::collections::generic::list_1::List_1<M0>, ::unity::OptionalMethod) -> ::unity::Array<M0> =
193                ::core::mem::transmute(__inflated.method_ptr);
194            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
195            __f(::core::convert::Into::into(list), ::core::option::Option::Some(__mi_opaque))
196        }
197    }
198
199    #[doc = "`Internal_ResizeList(crate::system::object::Object, i32)` overload"]
200    pub fn internal_resize_list(list: impl ::core::convert::Into<crate::system::object::Object>, size: impl ::core::convert::Into<i32>) -> () {
201        unsafe {
202            ::unity::il2cpp_call!((::unity::module_base()+0x32ede40usize)as*mut u8,();
203(crate::system::object::Object)::core::convert::Into::into(list),(i32)::core::convert::Into::into(size))
204        }
205    }
206
207    #[doc = "`ExtractArrayFromList(crate::system::object::Object)` overload"]
208    pub fn extract_array_from_list(list: impl ::core::convert::Into<crate::system::object::Object>) -> ::unity::IlInstance {
209        unsafe {
210            ::unity::il2cpp_call!((::unity::module_base()+0x32dc4b0usize)as*mut u8, ::unity::IlInstance;
211(crate::system::object::Object)::core::convert::Into::into(list))
212        }
213    }
214}
215
216#[cfg(feature = "unity_engine-noallochelpers")]
217impl NoAllocHelpers {
218    pub fn safe_length_method_info() -> &'static ::unity::il2cpp::MethodInfo {
219        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
220    }
221
222    pub fn internal_resize_list_method_info() -> &'static ::unity::il2cpp::MethodInfo {
223        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
224    }
225
226    pub fn extract_array_from_list_method_info() -> &'static ::unity::il2cpp::MethodInfo {
227        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
228    }
229}
230
231#[cfg(feature = "unity_engine-noallochelpers")]
232#[doc(hidden)]
233pub mod prelude {
234    pub use super::{INoAllocHelpers, NoAllocHelpers};
235    pub use crate::system::object::IObject;
236    #[cfg(feature = "system-object")]
237    pub use crate::system::object::IObjectMethods;
238}