Skip to main content

engage/generated/system/reflection/
icustomattributeprovider.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "system-reflection-icustomattributeprovider-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8
9    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/reflection/icustomattributeprovider/ICustomAttributeProvider.md"))]
10    #[::unity::class(namespace = "System.Reflection", name = "ICustomAttributeProvider")]
11    pub struct ICustomAttributeProvider {}
12}
13
14#[cfg(feature = "system-reflection-icustomattributeprovider-types")]
15pub use __types::*;
16
17#[cfg(feature = "system-reflection-icustomattributeprovider")]
18pub trait IICustomAttributeProviderMethods: IICustomAttributeProvider {
19    #[doc = "`GetCustomAttributes(::unity::SystemType, bool)` overload"]
20    fn get_custom_attributes(
21        self,
22        attribute_type: impl ::core::convert::Into<::unity::SystemType>,
23        inherit: impl ::core::convert::Into<bool>,
24    ) -> ::unity::Array<crate::system::object::Object> {
25        unsafe {
26            let __receiver =
27                <ICustomAttributeProvider as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
28            {
29                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
30                let __vi = *__vt.get(0usize).unwrap_or_else(|| {
31                    panic!(
32                        "unity: virtual slot {}
33 out of range (vtable len {}
34) on the runtime class behind {}
35 (method `{}
36`)",
37                        0usize,
38                        __vt.len(),
39                        <ICustomAttributeProvider as ::unity::ClassIdentity>::NAME,
40                        "GetCustomAttributes",
41                    )
42                });
43                let __inner: extern "C" fn(
44                    ICustomAttributeProvider,
45                    ::unity::SystemType,
46                    bool,
47                    ::unity::OptionalMethod,
48                ) -> ::unity::Array<crate::system::object::Object> = ::core::mem::transmute(__vi.method_ptr);
49                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
50                __inner(
51                    __receiver,
52                    ::core::convert::Into::into(attribute_type),
53                    ::core::convert::Into::into(inherit),
54                    __mi,
55                )
56            }
57        }
58    }
59    #[doc = "`IsDefined(::unity::SystemType, bool)` overload"]
60    fn is_defined(self, attribute_type: impl ::core::convert::Into<::unity::SystemType>, inherit: impl ::core::convert::Into<bool>) -> bool {
61        unsafe {
62            let __receiver =
63                <ICustomAttributeProvider as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
64            {
65                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
66                let __vi = *__vt.get(1usize).unwrap_or_else(|| {
67                    panic!(
68                        "unity: virtual slot {}
69 out of range (vtable len {}
70) on the runtime class behind {}
71 (method `{}
72`)",
73                        1usize,
74                        __vt.len(),
75                        <ICustomAttributeProvider as ::unity::ClassIdentity>::NAME,
76                        "IsDefined",
77                    )
78                });
79                let __inner: extern "C" fn(ICustomAttributeProvider, ::unity::SystemType, bool, ::unity::OptionalMethod) -> bool =
80                    ::core::mem::transmute(__vi.method_ptr);
81                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
82                __inner(
83                    __receiver,
84                    ::core::convert::Into::into(attribute_type),
85                    ::core::convert::Into::into(inherit),
86                    __mi,
87                )
88            }
89        }
90    }
91}
92
93#[cfg(feature = "system-reflection-icustomattributeprovider")]
94impl<__T: IICustomAttributeProvider> IICustomAttributeProviderMethods for __T {}
95
96#[cfg(feature = "system-reflection-icustomattributeprovider")]
97impl ICustomAttributeProvider {
98    pub fn get_custom_attributes_method_info() -> &'static ::unity::il2cpp::MethodInfo {
99        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
100    }
101
102    pub fn is_defined_method_info() -> &'static ::unity::il2cpp::MethodInfo {
103        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
104    }
105}
106
107#[cfg(feature = "system-reflection-icustomattributeprovider")]
108impl ICustomAttributeProvider {
109    #[doc = "Direct (non-virtual) call to `ICustomAttributeProvider`'s own `GetCustomAttributes`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
110    pub unsafe fn get_custom_attributes(
111        this: impl ::core::convert::Into<::unity::IlInstance>,
112        attribute_type: ::unity::SystemType,
113        inherit: bool,
114    ) -> ::unity::Array<crate::system::object::Object> {
115        let __mi = Self::get_custom_attributes_method_info();
116        let __inner: extern "C" fn(
117            ::unity::IlInstance,
118            ::unity::SystemType,
119            bool,
120            ::unity::OptionalMethod,
121        ) -> ::unity::Array<crate::system::object::Object> = ::core::mem::transmute(__mi.method_ptr);
122        __inner(this.into(), attribute_type, inherit, ::core::option::Option::None)
123    }
124
125    #[doc = "Direct (non-virtual) call to `ICustomAttributeProvider`'s own `IsDefined`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
126    pub unsafe fn is_defined(this: impl ::core::convert::Into<::unity::IlInstance>, attribute_type: ::unity::SystemType, inherit: bool) -> bool {
127        let __mi = Self::is_defined_method_info();
128        let __inner: extern "C" fn(::unity::IlInstance, ::unity::SystemType, bool, ::unity::OptionalMethod) -> bool =
129            ::core::mem::transmute(__mi.method_ptr);
130        __inner(this.into(), attribute_type, inherit, ::core::option::Option::None)
131    }
132}
133
134#[cfg(feature = "system-reflection-icustomattributeprovider")]
135#[doc(hidden)]
136pub mod prelude {
137    pub use super::{ICustomAttributeProvider, IICustomAttributeProvider, IICustomAttributeProviderMethods};
138}