Skip to main content

engage/generated/system/collections/
iequalitycomparer.rs

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