engage/generated/unity_engine/switch/
networkinterfacewrapper.rs1#[cfg(feature = "unity_engine-switch-networkinterfacewrapper-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::{
9 delegate::{Delegate, IDelegate},
10 multicastdelegate::{IMulticastDelegate, MulticastDelegate},
11 object::{IObject, Object},
12 r#enum::{Enum, IEnum},
13 valuetype::{IValueType, ValueType},
14 };
15
16 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/switch/networkinterfacewrapper/NetworkInterfaceWrapper.md"))]
17 #[::unity::class(namespace = "UnityEngine.Switch", name = "NetworkInterfaceWrapper")]
18 #[parent(crate::system::object::Object)]
19 pub struct NetworkInterfaceWrapper {
20 #[static_field]
21 #[rename(name = "_networkConnected")]
22 pub network_connected: crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedHandler,
23 }
24
25 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/switch/networkinterfacewrapper/NetworkInterfaceWrapper_NetworkConnectedResult.md"))]
26 #[repr(C)]
27 #[derive(::core::clone::Clone, ::core::marker::Copy, ::core::fmt::Debug, ::core::cmp::PartialEq, ::core::cmp::Eq)]
28 pub struct NetworkInterfaceWrapper_NetworkConnectedResult {
29 pub value: i32,
30 }
31 impl ::unity::ClassIdentity for NetworkInterfaceWrapper_NetworkConnectedResult {
32 const NAME: &'static str = "NetworkInterfaceWrapper.NetworkConnectedResult";
33 const NAMESPACE: &'static str = "UnityEngine.Switch";
34
35 fn class() -> ::unity::Class {
36 static CACHE: ::std::sync::OnceLock<::unity::Class> = ::std::sync::OnceLock::new();
37 *CACHE.get_or_init(|| ::unity::Class::lookup(Self::NAMESPACE, Self::NAME))
38 }
39 }
40 impl ::unity::IlType for NetworkInterfaceWrapper_NetworkConnectedResult {
41 fn il_type() -> &'static ::unity::il2cpp::Il2CppType {
42 &<Self as ::unity::ClassIdentity>::class().raw()._1.byval_arg
43 }
44 }
45 impl NetworkInterfaceWrapper_NetworkConnectedResult {
46 pub fn pending() -> Self {
47 Self { value: -1 }
48 }
49
50 pub fn denied() -> Self {
51 Self { value: 0 }
52 }
53
54 pub fn accepted() -> Self {
55 Self { value: 1 }
56 }
57 }
58
59 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/switch/networkinterfacewrapper/NetworkInterfaceWrapper_NetworkConnectedHandler.md"))]
60 #[::unity::class(namespace = "UnityEngine.Switch", name = "NetworkInterfaceWrapper.NetworkConnectedHandler")]
61 #[parent(crate::system::multicastdelegate::MulticastDelegate)]
62 pub struct NetworkInterfaceWrapper_NetworkConnectedHandler {}
63}
64
65#[cfg(feature = "unity_engine-switch-networkinterfacewrapper-types")]
66pub use __types::*;
67
68#[cfg(feature = "unity_engine-switch-networkinterfacewrapper")]
69impl NetworkInterfaceWrapper {
70 #[doc = "`EnterNetworkConnecting(bool)` overload"]
71 pub fn enter_network_connecting(is_local_network_mode: impl ::core::convert::Into<bool>) -> bool {
72 unsafe {
73 ::unity::il2cpp_call!((::unity::module_base()+0x3f408a0usize)as*mut u8,bool;
74(bool)::core::convert::Into::into(is_local_network_mode))
75 }
76 }
77
78 #[doc = "`EnterNetworkConnecting(bool, bool)` overload"]
79 pub fn enter_network_connecting_2(
80 is_local_network_mode: impl ::core::convert::Into<bool>,
81 report_if_unavailable: impl ::core::convert::Into<bool>,
82 ) -> bool {
83 unsafe {
84 ::unity::il2cpp_call!((::unity::module_base()+0x3f408f0usize)as*mut u8,bool;
85(bool)::core::convert::Into::into(is_local_network_mode),(bool)::core::convert::Into::into(report_if_unavailable))
86 }
87 }
88
89 #[doc = "`WeakEnterNetworkConnecting()` overload"]
90 pub fn weak_enter_network_connecting() -> bool {
91 unsafe {
92 ::unity::il2cpp_call!((::unity::module_base()+0x3f40940usize)as*mut u8,bool;
93 )
94 }
95 }
96
97 #[doc = "`LeaveNetworkConnecting()` overload"]
98 pub fn leave_network_connecting() -> () {
99 unsafe {
100 ::unity::il2cpp_call!((::unity::module_base()+0x3f40980usize)as*mut u8,();
101 )
102 }
103 }
104
105 #[doc = "`IsNetworkConnecting()` overload"]
106 pub fn is_network_connecting() -> bool {
107 unsafe {
108 ::unity::il2cpp_call!((::unity::module_base()+0x3f409c0usize)as*mut u8,bool;
109 )
110 }
111 }
112
113 #[doc = "`WaitForNetworkConnecting()` overload"]
114 pub fn wait_for_network_connecting() -> () {
115 unsafe {
116 ::unity::il2cpp_call!((::unity::module_base()+0x3f40a00usize)as*mut u8,();
117 )
118 }
119 }
120
121 #[doc = "`IsNetworkAccepted()` overload"]
122 pub fn is_network_accepted() -> bool {
123 unsafe {
124 ::unity::il2cpp_call!((::unity::module_base()+0x3f40a40usize)as*mut u8,bool;
125 )
126 }
127 }
128
129 #[doc = "`IsNetworkFinished()` overload"]
130 pub fn is_network_finished() -> bool {
131 unsafe {
132 ::unity::il2cpp_call!((::unity::module_base()+0x3f40a80usize)as*mut u8,bool;
133 )
134 }
135 }
136
137 #[doc = "`GetNetworkReferenceCount()` overload"]
138 pub fn get_network_reference_count() -> i32 {
139 unsafe {
140 ::unity::il2cpp_call!((::unity::module_base()+0x3f40ac0usize)as*mut u8,i32;
141 )
142 }
143 }
144
145 #[doc = "`IsNetworkAvailable()` overload"]
146 pub fn is_network_available() -> bool {
147 unsafe {
148 ::unity::il2cpp_call!((::unity::module_base()+0x3f40b00usize)as*mut u8,bool;
149 )
150 }
151 }
152
153 #[doc = "`IsNetworkConnectingOnBackground()` overload"]
154 pub fn is_network_connecting_on_background() -> bool {
155 unsafe {
156 ::unity::il2cpp_call!((::unity::module_base()+0x3f40b40usize)as*mut u8,bool;
157 )
158 }
159 }
160
161 #[doc = "`SetNetworkConnectingOnBackground(bool)` overload"]
162 pub fn set_network_connecting_on_background(is_background: impl ::core::convert::Into<bool>) -> () {
163 unsafe {
164 ::unity::il2cpp_call!((::unity::module_base()+0x3f40b80usize)as*mut u8,();
165(bool)::core::convert::Into::into(is_background))
166 }
167 }
168
169 #[doc = "`SetNetworkConnectedEnabled(bool)` overload"]
170 pub fn set_network_connected_enabled(is_enabled: impl ::core::convert::Into<bool>) -> () {
171 unsafe {
172 ::unity::il2cpp_call!((::unity::module_base()+0x3f40bd0usize)as*mut u8,();
173(bool)::core::convert::Into::into(is_enabled))
174 }
175 }
176
177 #[doc = "`InvokeNetworkConnected()` overload"]
178 pub fn invoke_network_connected() -> i32 {
179 unsafe {
180 ::unity::il2cpp_call!((::unity::module_base()+0x3f40c20usize)as*mut u8,i32;
181 )
182 }
183 }
184
185 #[doc = "`add_networkConnected(crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedHandler)` overload"]
186 pub fn add_network_connected(
187 value: impl ::core::convert::Into<crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedHandler>,
188 ) -> () {
189 unsafe {
190 ::unity::il2cpp_call!((::unity::module_base()+0x3f40e90usize)as*mut u8,();
191(crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedHandler)::core::convert::Into::into(value))
192 }
193 }
194
195 #[doc = "`remove_networkConnected(crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedHandler)` overload"]
196 pub fn remove_network_connected(
197 value: impl ::core::convert::Into<crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedHandler>,
198 ) -> () {
199 unsafe {
200 ::unity::il2cpp_call!((::unity::module_base()+0x3f41040usize)as*mut u8,();
201(crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedHandler)::core::convert::Into::into(value))
202 }
203 }
204}
205
206#[cfg(feature = "unity_engine-switch-networkinterfacewrapper")]
207impl NetworkInterfaceWrapper {
208 pub fn enter_network_connecting_method_info() -> &'static ::unity::il2cpp::MethodInfo {
209 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
210 }
211
212 pub fn enter_network_connecting_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
213 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
214 }
215
216 pub fn weak_enter_network_connecting_method_info() -> &'static ::unity::il2cpp::MethodInfo {
217 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
218 }
219
220 pub fn leave_network_connecting_method_info() -> &'static ::unity::il2cpp::MethodInfo {
221 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
222 }
223
224 pub fn is_network_connecting_method_info() -> &'static ::unity::il2cpp::MethodInfo {
225 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
226 }
227
228 pub fn wait_for_network_connecting_method_info() -> &'static ::unity::il2cpp::MethodInfo {
229 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
230 }
231
232 pub fn is_network_accepted_method_info() -> &'static ::unity::il2cpp::MethodInfo {
233 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
234 }
235
236 pub fn is_network_finished_method_info() -> &'static ::unity::il2cpp::MethodInfo {
237 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
238 }
239
240 pub fn get_network_reference_count_method_info() -> &'static ::unity::il2cpp::MethodInfo {
241 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
242 }
243
244 pub fn is_network_available_method_info() -> &'static ::unity::il2cpp::MethodInfo {
245 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
246 }
247
248 pub fn is_network_connecting_on_background_method_info() -> &'static ::unity::il2cpp::MethodInfo {
249 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
250 }
251
252 pub fn set_network_connecting_on_background_method_info() -> &'static ::unity::il2cpp::MethodInfo {
253 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
254 }
255
256 pub fn set_network_connected_enabled_method_info() -> &'static ::unity::il2cpp::MethodInfo {
257 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[12]
258 }
259
260 pub fn invoke_network_connected_method_info() -> &'static ::unity::il2cpp::MethodInfo {
261 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[13]
262 }
263
264 pub fn add_network_connected_method_info() -> &'static ::unity::il2cpp::MethodInfo {
265 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
266 }
267
268 pub fn remove_network_connected_method_info() -> &'static ::unity::il2cpp::MethodInfo {
269 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
270 }
271}
272
273#[cfg(feature = "unity_engine-switch-networkinterfacewrapper")]
274pub trait INetworkInterfaceWrapper_NetworkConnectedHandlerMethods: INetworkInterfaceWrapper_NetworkConnectedHandler {
275 #[doc = "`.ctor(crate::system::object::Object, ::unity::IntPtr)` overload"]
276 fn ctor(self, object: impl ::core::convert::Into<crate::system::object::Object>, method: impl ::core::convert::Into<::unity::IntPtr>) -> () {
277 unsafe {
278 let __receiver = <NetworkInterfaceWrapper_NetworkConnectedHandler as ::unity::FromIlInstance>::from_il_instance(
279 <Self as ::unity::SystemObject>::as_instance(self),
280 );
281 ::unity::il2cpp_call!((::unity::module_base()+0x3f41d90usize)as*mut u8,();
282(NetworkInterfaceWrapper_NetworkConnectedHandler)__receiver,(crate::system::object::Object)::core::convert::Into::into(object),(::unity::IntPtr)::core::convert::Into::into(method))
283 }
284 }
285 #[doc = "`Invoke()` overload"]
286 fn invoke(self) -> crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedResult {
287 unsafe {
288 let __receiver = <NetworkInterfaceWrapper_NetworkConnectedHandler as ::unity::FromIlInstance>::from_il_instance(
289 <Self as ::unity::SystemObject>::as_instance(self),
290 );
291 {
292 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
293 let __vi = *__vt.get(13usize).unwrap_or_else(|| {
294 panic!(
295 "unity: virtual slot {}
296 out of range (vtable len {}
297) on the runtime class behind {}
298 (method `{}
299`)",
300 13usize,
301 __vt.len(),
302 <NetworkInterfaceWrapper_NetworkConnectedHandler as ::unity::ClassIdentity>::NAME,
303 "Invoke",
304 )
305 });
306 let __inner: extern "C" fn(
307 NetworkInterfaceWrapper_NetworkConnectedHandler,
308 ::unity::OptionalMethod,
309 )
310 -> crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedResult =
311 ::core::mem::transmute(__vi.method_ptr);
312 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
313 __inner(__receiver, __mi)
314 }
315 }
316 }
317}
318
319#[cfg(feature = "unity_engine-switch-networkinterfacewrapper")]
320impl<__T: INetworkInterfaceWrapper_NetworkConnectedHandler> INetworkInterfaceWrapper_NetworkConnectedHandlerMethods for __T {}
321
322#[cfg(feature = "unity_engine-switch-networkinterfacewrapper")]
323impl NetworkInterfaceWrapper_NetworkConnectedHandler {
324 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
325 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
326 }
327
328 pub fn invoke_method_info() -> &'static ::unity::il2cpp::MethodInfo {
329 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
330 }
331}
332
333#[cfg(feature = "unity_engine-switch-networkinterfacewrapper")]
334impl NetworkInterfaceWrapper_NetworkConnectedHandler {
335 #[doc = "Direct (non-virtual) call to `NetworkInterfaceWrapper_NetworkConnectedHandler`'s own `Invoke`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
336 pub unsafe fn invoke(
337 this: impl ::core::convert::Into<::unity::IlInstance>,
338 ) -> crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedResult {
339 let __mi = Self::invoke_method_info();
340 let __inner: extern "C" fn(
341 ::unity::IlInstance,
342 ::unity::OptionalMethod,
343 ) -> crate::unity_engine::switch::networkinterfacewrapper::NetworkInterfaceWrapper_NetworkConnectedResult =
344 ::core::mem::transmute(__mi.method_ptr);
345 __inner(this.into(), ::core::option::Option::None)
346 }
347}
348
349#[cfg(feature = "unity_engine-switch-networkinterfacewrapper")]
350impl NetworkInterfaceWrapper_NetworkConnectedHandler {
351 #[doc = "`.ctor(crate::system::object::Object, ::unity::IntPtr)` — overload selector"]
352 pub fn new(object: crate::system::object::Object, method: ::unity::IntPtr) -> Self {
353 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
354 panic!(
355 "{}
356::{}
357 failed to instantiate",
358 ::core::stringify!(NetworkInterfaceWrapper_NetworkConnectedHandler),
359 ::core::stringify!(new),
360 )
361 });
362 <Self as INetworkInterfaceWrapper_NetworkConnectedHandlerMethods>::ctor(this, object, method);
363 this
364 }
365}
366
367#[cfg(feature = "unity_engine-switch-networkinterfacewrapper")]
368#[doc(hidden)]
369pub mod prelude {
370 pub use super::{
371 INetworkInterfaceWrapper, INetworkInterfaceWrapper_NetworkConnectedHandler, INetworkInterfaceWrapper_NetworkConnectedHandlerMethods,
372 NetworkInterfaceWrapper, NetworkInterfaceWrapper_NetworkConnectedHandler, NetworkInterfaceWrapper_NetworkConnectedResult,
373 };
374 #[cfg(feature = "system-delegate")]
375 pub use crate::system::delegate::IDelegateMethods;
376 #[cfg(feature = "system-multicastdelegate")]
377 pub use crate::system::multicastdelegate::IMulticastDelegateMethods;
378 #[cfg(feature = "system-object")]
379 pub use crate::system::object::IObjectMethods;
380 #[cfg(feature = "system-enum")]
381 pub use crate::system::r#enum::IEnumMethods;
382 #[cfg(feature = "system-valuetype")]
383 pub use crate::system::valuetype::IValueTypeMethods;
384 pub use crate::system::{delegate::IDelegate, multicastdelegate::IMulticastDelegate, object::IObject, r#enum::IEnum, valuetype::IValueType};
385}