Skip to main content

engage/generated/system/collections/
ienumerator.rs

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