Skip to main content

engage/generated/unity_engine/resource_management/util/
iallocationstrategy.rs

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