Skip to main content

engage/generated/moon_sharp/interpreter/diagnostics/performance_counters/
performancestopwatch.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch-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/moon_sharp/interpreter/diagnostics/performance_counters/performancestopwatch/PerformanceStopwatch.md"))]
11    #[::unity::class(namespace = "MoonSharp.Interpreter.Diagnostics.PerformanceCounters", name = "PerformanceStopwatch")]
12    #[parent(crate::system::object::Object)]
13    pub struct PerformanceStopwatch {
14        #[offset(24)]
15        #[rename(name = "m_Count")]
16        pub m_count: i32,
17        #[offset(28)]
18        #[rename(name = "m_Reentrant")]
19        pub m_reentrant: i32,
20        #[offset(32)]
21        #[rename(name = "m_Counter")]
22        pub m_counter: crate::moon_sharp::interpreter::diagnostics::performancecounter::PerformanceCounter,
23    }
24}
25
26#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch-types")]
27pub use __types::*;
28
29#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch")]
30#[doc(hidden)]
31#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
32mod __PerformanceStopwatch_unity_raw {
33    use super::*;
34    #[doc(hidden)]
35    #[allow(non_snake_case)]
36    pub mod __lookup_ctor {
37        use super::*;
38        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
39            let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
40                &[<crate::moon_sharp::interpreter::diagnostics::performancecounter::PerformanceCounter as ::unity::IlType>::il_type()];
41            ::unity::lookup::method_info_on_class_with_signature(
42                <PerformanceStopwatch as ::unity::ClassIdentity>::class(),
43                ".ctor",
44                1,
45                param_types,
46                false,
47            )
48        });
49        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
50            match &*METHOD {
51                ::core::result::Result::Ok(mi) => *mi,
52                ::core::result::Result::Err(e) => {
53                    panic!(
54                        "method lookup failed: {}
55::{}
56: {}
57",
58                        <PerformanceStopwatch as ::unity::ClassIdentity>::NAME,
59                        ".ctor",
60                        e
61                    )
62                },
63            }
64        }
65    }
66}
67
68#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch")]
69pub trait IPerformanceStopwatchMethods: IPerformanceStopwatch {
70    #[doc = "`.ctor(crate::moon_sharp::interpreter::diagnostics::performancecounter::PerformanceCounter)` overload"]
71    fn ctor(
72        self,
73        perfcounter: impl ::core::convert::Into<crate::moon_sharp::interpreter::diagnostics::performancecounter::PerformanceCounter>,
74    ) -> () {
75        unsafe {
76            let __receiver = <PerformanceStopwatch as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
77            ::unity::il2cpp_call!(__PerformanceStopwatch_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
78(PerformanceStopwatch)__receiver,(crate::moon_sharp::interpreter::diagnostics::performancecounter::PerformanceCounter)::core::convert::Into::into(perfcounter))
79        }
80    }
81    #[doc = "`Dispose()` overload"]
82    fn dispose(self) -> () {
83        unsafe {
84            let __receiver = <PerformanceStopwatch as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
85            {
86                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
87                let __vi = *__vt.get(4usize).unwrap_or_else(|| {
88                    panic!(
89                        "unity: virtual slot {}
90 out of range (vtable len {}
91) on the runtime class behind {}
92 (method `{}
93`)",
94                        4usize,
95                        __vt.len(),
96                        <PerformanceStopwatch as ::unity::ClassIdentity>::NAME,
97                        "Dispose",
98                    )
99                });
100                let __inner: extern "C" fn(PerformanceStopwatch, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
101                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
102                __inner(__receiver, __mi)
103            }
104        }
105    }
106    #[doc = "`GetResult()` overload"]
107    fn get_result(self) -> crate::moon_sharp::interpreter::diagnostics::performanceresult::PerformanceResult {
108        unsafe {
109            let __receiver = <PerformanceStopwatch as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
110            {
111                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
112                let __vi = *__vt.get(6usize).unwrap_or_else(|| {
113                    panic!(
114                        "unity: virtual slot {}
115 out of range (vtable len {}
116) on the runtime class behind {}
117 (method `{}
118`)",
119                        6usize,
120                        __vt.len(),
121                        <PerformanceStopwatch as ::unity::ClassIdentity>::NAME,
122                        "GetResult",
123                    )
124                });
125                let __inner: extern "C" fn(
126                    PerformanceStopwatch,
127                    ::unity::OptionalMethod,
128                ) -> crate::moon_sharp::interpreter::diagnostics::performanceresult::PerformanceResult = ::core::mem::transmute(__vi.method_ptr);
129                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
130                __inner(__receiver, __mi)
131            }
132        }
133    }
134}
135
136#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch")]
137impl<__T: IPerformanceStopwatch> IPerformanceStopwatchMethods for __T {}
138
139#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch")]
140impl PerformanceStopwatch {
141    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
142        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
143    }
144
145    pub fn dispose_method_info() -> &'static ::unity::il2cpp::MethodInfo {
146        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
147    }
148
149    pub fn get_result_method_info() -> &'static ::unity::il2cpp::MethodInfo {
150        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
151    }
152}
153
154#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch")]
155impl PerformanceStopwatch {
156    #[doc = "Direct (non-virtual) call to `PerformanceStopwatch`'s own `Dispose`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
157    pub unsafe fn dispose(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
158        let __mi = Self::dispose_method_info();
159        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
160        __inner(this.into(), ::core::option::Option::None)
161    }
162
163    #[doc = "Direct (non-virtual) call to `PerformanceStopwatch`'s own `GetResult`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
164    pub unsafe fn get_result(
165        this: impl ::core::convert::Into<::unity::IlInstance>,
166    ) -> crate::moon_sharp::interpreter::diagnostics::performanceresult::PerformanceResult {
167        let __mi = Self::get_result_method_info();
168        let __inner: extern "C" fn(
169            ::unity::IlInstance,
170            ::unity::OptionalMethod,
171        ) -> crate::moon_sharp::interpreter::diagnostics::performanceresult::PerformanceResult = ::core::mem::transmute(__mi.method_ptr);
172        __inner(this.into(), ::core::option::Option::None)
173    }
174}
175
176#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch")]
177impl PerformanceStopwatch {
178    #[doc = "`.ctor(crate::moon_sharp::interpreter::diagnostics::performancecounter::PerformanceCounter)` — overload selector"]
179    pub fn new(perfcounter: crate::moon_sharp::interpreter::diagnostics::performancecounter::PerformanceCounter) -> Self {
180        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
181            panic!(
182                "{}
183::{}
184 failed to instantiate",
185                ::core::stringify!(PerformanceStopwatch),
186                ::core::stringify!(new),
187            )
188        });
189        <Self as IPerformanceStopwatchMethods>::ctor(this, perfcounter);
190        this
191    }
192}
193
194#[cfg(feature = "moon_sharp-interpreter-diagnostics-performance_counters-performancestopwatch")]
195#[doc(hidden)]
196pub mod prelude {
197    pub use super::{IPerformanceStopwatch, IPerformanceStopwatchMethods, PerformanceStopwatch};
198    pub use crate::system::object::IObject;
199    #[cfg(feature = "system-object")]
200    pub use crate::system::object::IObjectMethods;
201}