Skip to main content

engage/generated/system/reflection/
customattributeextensions.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "system-reflection-customattributeextensions-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/reflection/customattributeextensions/CustomAttributeExtensions.md"))]
11    #[::unity::class(namespace = "System.Reflection", name = "CustomAttributeExtensions")]
12    #[parent(crate::system::object::Object)]
13    pub struct CustomAttributeExtensions {}
14}
15
16#[cfg(feature = "system-reflection-customattributeextensions-types")]
17pub use __types::*;
18
19#[cfg(feature = "system-reflection-customattributeextensions")]
20impl CustomAttributeExtensions {
21    pub fn get_custom_attribute<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
22        element: impl ::core::convert::Into<crate::system::reflection::assembly::Assembly>,
23    ) -> M0 {
24        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
25            ::unity::lookup::method_info_on_class(<CustomAttributeExtensions as ::unity::ClassIdentity>::class(), "GetCustomAttribute", 1)
26        });
27        #[allow(clippy::type_complexity)]
28        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
29            ::std::sync::OnceLock::new();
30        let _ = true;
31        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
32            ::core::result::Result::Ok(mi) => *mi,
33            ::core::result::Result::Err(e) => {
34                panic!(
35                    "method lookup failed: {}
36::{}
37: {}
38",
39                    <CustomAttributeExtensions as ::unity::ClassIdentity>::NAME,
40                    "GetCustomAttribute",
41                    e
42                )
43            },
44        };
45        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
46        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
47        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
48            let mut __guard = __cache.lock().unwrap();
49            *__guard
50                .entry(__key)
51                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
52        };
53        unsafe {
54            let __f: extern "C" fn(crate::system::reflection::assembly::Assembly, ::unity::OptionalMethod) -> M0 =
55                ::core::mem::transmute(__inflated.method_ptr);
56            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
57            __f(::core::convert::Into::into(element), ::core::option::Option::Some(__mi_opaque))
58        }
59    }
60
61    pub fn get_custom_attributes<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
62        element: impl ::core::convert::Into<crate::system::reflection::memberinfo::MemberInfo>,
63    ) -> crate::system::collections::generic::ienumerable_1::IEnumerable_1<M0> {
64        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
65            ::unity::lookup::method_info_on_class(<CustomAttributeExtensions as ::unity::ClassIdentity>::class(), "GetCustomAttributes", 1)
66        });
67        #[allow(clippy::type_complexity)]
68        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
69            ::std::sync::OnceLock::new();
70        let _ = true;
71        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
72            ::core::result::Result::Ok(mi) => *mi,
73            ::core::result::Result::Err(e) => {
74                panic!(
75                    "method lookup failed: {}
76::{}
77: {}
78",
79                    <CustomAttributeExtensions as ::unity::ClassIdentity>::NAME,
80                    "GetCustomAttributes",
81                    e
82                )
83            },
84        };
85        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
86        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
87        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
88            let mut __guard = __cache.lock().unwrap();
89            *__guard
90                .entry(__key)
91                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
92        };
93        unsafe {
94            let __f: extern "C" fn(
95                crate::system::reflection::memberinfo::MemberInfo,
96                ::unity::OptionalMethod,
97            ) -> crate::system::collections::generic::ienumerable_1::IEnumerable_1<M0> = ::core::mem::transmute(__inflated.method_ptr);
98            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
99            __f(::core::convert::Into::into(element), ::core::option::Option::Some(__mi_opaque))
100        }
101    }
102}
103
104#[cfg(feature = "system-reflection-customattributeextensions")]
105#[doc(hidden)]
106pub mod prelude {
107    pub use super::{CustomAttributeExtensions, ICustomAttributeExtensions};
108    pub use crate::system::object::IObject;
109    #[cfg(feature = "system-object")]
110    pub use crate::system::object::IObjectMethods;
111}