engage/generated/unity_engine/resource_management/util/
defaultallocationstrategy.rs1#[cfg(feature = "unity_engine-resource_management-util-defaultallocationstrategy-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/unity_engine/resource_management/util/defaultallocationstrategy/DefaultAllocationStrategy.md"))]
11 #[::unity::class(namespace = "UnityEngine.ResourceManagement.Util", name = "DefaultAllocationStrategy")]
12 #[parent(crate::system::object::Object)]
13 pub struct DefaultAllocationStrategy {}
14}
15
16#[cfg(feature = "unity_engine-resource_management-util-defaultallocationstrategy-types")]
17pub use __types::*;
18
19#[cfg(feature = "unity_engine-resource_management-util-defaultallocationstrategy")]
20#[doc(hidden)]
21#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
22mod __DefaultAllocationStrategy_unity_raw {
23 use super::*;
24 #[doc(hidden)]
25 #[allow(non_snake_case)]
26 pub mod __lookup_ctor {
27 use super::*;
28 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
29 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[];
30 ::unity::lookup::method_info_on_class_with_signature(
31 <DefaultAllocationStrategy as ::unity::ClassIdentity>::class(),
32 ".ctor",
33 0,
34 param_types,
35 false,
36 )
37 });
38 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
39 match &*METHOD {
40 ::core::result::Result::Ok(mi) => *mi,
41 ::core::result::Result::Err(e) => {
42 panic!(
43 "method lookup failed: {}
44::{}
45: {}
46",
47 <DefaultAllocationStrategy as ::unity::ClassIdentity>::NAME,
48 ".ctor",
49 e
50 )
51 },
52 }
53 }
54 }
55}
56
57#[cfg(feature = "unity_engine-resource_management-util-defaultallocationstrategy")]
58pub trait IDefaultAllocationStrategyMethods: IDefaultAllocationStrategy {
59 #[doc = "`New(::unity::SystemType, i32)` overload"]
60 fn new(
61 self,
62 r#type: impl ::core::convert::Into<::unity::SystemType>,
63 type_hash: impl ::core::convert::Into<i32>,
64 ) -> crate::system::object::Object {
65 unsafe {
66 let __receiver =
67 <DefaultAllocationStrategy as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
68 {
69 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
70 let __vi = *__vt.get(4usize).unwrap_or_else(|| {
71 panic!(
72 "unity: virtual slot {}
73 out of range (vtable len {}
74) on the runtime class behind {}
75 (method `{}
76`)",
77 4usize,
78 __vt.len(),
79 <DefaultAllocationStrategy as ::unity::ClassIdentity>::NAME,
80 "New",
81 )
82 });
83 let __inner: extern "C" fn(
84 DefaultAllocationStrategy,
85 ::unity::SystemType,
86 i32,
87 ::unity::OptionalMethod,
88 ) -> crate::system::object::Object = ::core::mem::transmute(__vi.method_ptr);
89 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
90 __inner(
91 __receiver,
92 ::core::convert::Into::into(r#type),
93 ::core::convert::Into::into(type_hash),
94 __mi,
95 )
96 }
97 }
98 }
99 #[doc = "`Release(i32, crate::system::object::Object)` overload"]
100 fn release(self, type_hash: impl ::core::convert::Into<i32>, obj: impl ::core::convert::Into<crate::system::object::Object>) -> () {
101 unsafe {
102 let __receiver =
103 <DefaultAllocationStrategy as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
104 {
105 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
106 let __vi = *__vt.get(5usize).unwrap_or_else(|| {
107 panic!(
108 "unity: virtual slot {}
109 out of range (vtable len {}
110) on the runtime class behind {}
111 (method `{}
112`)",
113 5usize,
114 __vt.len(),
115 <DefaultAllocationStrategy as ::unity::ClassIdentity>::NAME,
116 "Release",
117 )
118 });
119 let __inner: extern "C" fn(DefaultAllocationStrategy, i32, crate::system::object::Object, ::unity::OptionalMethod) -> () =
120 ::core::mem::transmute(__vi.method_ptr);
121 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
122 __inner(__receiver, ::core::convert::Into::into(type_hash), ::core::convert::Into::into(obj), __mi)
123 }
124 }
125 }
126 #[doc = "`.ctor()` overload"]
127 fn ctor(self) -> () {
128 unsafe {
129 let __receiver =
130 <DefaultAllocationStrategy as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
131 ::unity::il2cpp_call!(__DefaultAllocationStrategy_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
132(DefaultAllocationStrategy)__receiver)
133 }
134 }
135}
136
137#[cfg(feature = "unity_engine-resource_management-util-defaultallocationstrategy")]
138impl<__T: IDefaultAllocationStrategy> IDefaultAllocationStrategyMethods for __T {}
139
140#[cfg(feature = "unity_engine-resource_management-util-defaultallocationstrategy")]
141impl DefaultAllocationStrategy {
142 pub fn new_method_info() -> &'static ::unity::il2cpp::MethodInfo {
143 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
144 }
145
146 pub fn release_method_info() -> &'static ::unity::il2cpp::MethodInfo {
147 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
148 }
149
150 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
151 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
152 }
153}
154
155#[cfg(feature = "unity_engine-resource_management-util-defaultallocationstrategy")]
156impl DefaultAllocationStrategy {
157 #[doc = "Direct (non-virtual) call to `DefaultAllocationStrategy`'s own `New`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
158 pub unsafe fn new(
159 this: impl ::core::convert::Into<::unity::IlInstance>,
160 r#type: ::unity::SystemType,
161 type_hash: i32,
162 ) -> crate::system::object::Object {
163 let __mi = Self::new_method_info();
164 let __inner: extern "C" fn(::unity::IlInstance, ::unity::SystemType, i32, ::unity::OptionalMethod) -> crate::system::object::Object =
165 ::core::mem::transmute(__mi.method_ptr);
166 __inner(this.into(), r#type, type_hash, ::core::option::Option::None)
167 }
168
169 #[doc = "Direct (non-virtual) call to `DefaultAllocationStrategy`'s own `Release`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
170 pub unsafe fn release(this: impl ::core::convert::Into<::unity::IlInstance>, type_hash: i32, obj: crate::system::object::Object) -> () {
171 let __mi = Self::release_method_info();
172 let __inner: extern "C" fn(::unity::IlInstance, i32, crate::system::object::Object, ::unity::OptionalMethod) -> () =
173 ::core::mem::transmute(__mi.method_ptr);
174 __inner(this.into(), type_hash, obj, ::core::option::Option::None)
175 }
176}
177
178#[cfg(feature = "unity_engine-resource_management-util-defaultallocationstrategy")]
179#[doc(hidden)]
180pub mod prelude {
181 pub use super::{DefaultAllocationStrategy, IDefaultAllocationStrategy, IDefaultAllocationStrategyMethods};
182 pub use crate::system::object::IObject;
183 #[cfg(feature = "system-object")]
184 pub use crate::system::object::IObjectMethods;
185}