Skip to main content

engage/generated/moon_sharp/interpreter/tree/statements/
functiondefinitionstatement.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::{
9        moon_sharp::interpreter::tree::{
10            nodebase::{INodeBase, NodeBase},
11            statement::{IStatement, Statement},
12        },
13        system::object::{IObject, Object},
14    };
15
16    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/tree/statements/functiondefinitionstatement/FunctionDefinitionStatement.md"))]
17    #[::unity::class(namespace = "MoonSharp.Interpreter.Tree.Statements", name = "FunctionDefinitionStatement")]
18    #[parent(crate::moon_sharp::interpreter::tree::statement::Statement)]
19    pub struct FunctionDefinitionStatement {
20        #[offset(32)]
21        #[rename(name = "m_FuncSymbol")]
22        pub m_func_symbol: crate::moon_sharp::interpreter::symbolref::SymbolRef,
23        #[offset(40)]
24        #[rename(name = "m_SourceRef")]
25        pub m_source_ref: crate::moon_sharp::interpreter::debugging::sourceref::SourceRef,
26        #[offset(48)]
27        #[rename(name = "m_Local")]
28        pub m_local: bool,
29        #[offset(49)]
30        #[rename(name = "m_IsMethodCallingConvention")]
31        pub m_is_method_calling_convention: bool,
32        #[offset(56)]
33        #[rename(name = "m_MethodName")]
34        pub m_method_name: ::unity::Il2CppString,
35        #[offset(64)]
36        #[rename(name = "m_FriendlyName")]
37        pub m_friendly_name: ::unity::Il2CppString,
38        #[offset(72)]
39        #[rename(name = "m_TableAccessors")]
40        pub m_table_accessors: crate::system::collections::generic::list_1::List_1<::unity::Il2CppString>,
41        #[offset(80)]
42        #[rename(name = "m_FuncDef")]
43        pub m_func_def: crate::moon_sharp::interpreter::tree::expressions::functiondefinitionexpression::FunctionDefinitionExpression,
44    }
45}
46
47#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement-types")]
48pub use __types::*;
49
50#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement")]
51#[doc(hidden)]
52#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
53mod __FunctionDefinitionStatement_unity_raw {
54    use super::*;
55    #[doc(hidden)]
56    #[allow(non_snake_case)]
57    pub mod __lookup_ctor {
58        use super::*;
59        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
60            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
61                <crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext as ::unity::IlType>::il_type(),
62                <bool as ::unity::IlType>::il_type(),
63                <crate::moon_sharp::interpreter::tree::token::Token as ::unity::IlType>::il_type(),
64            ];
65            ::unity::lookup::method_info_on_class_with_signature(
66                <FunctionDefinitionStatement as ::unity::ClassIdentity>::class(),
67                ".ctor",
68                3,
69                param_types,
70                false,
71            )
72        });
73        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
74            match &*METHOD {
75                ::core::result::Result::Ok(mi) => *mi,
76                ::core::result::Result::Err(e) => {
77                    panic!(
78                        "method lookup failed: {}
79::{}
80: {}
81",
82                        <FunctionDefinitionStatement as ::unity::ClassIdentity>::NAME,
83                        ".ctor",
84                        e
85                    )
86                },
87            }
88        }
89    }
90    #[doc(hidden)]
91    #[allow(non_snake_case)]
92    pub mod __lookup_set_method {
93        use super::*;
94        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
95            let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
96                &[<crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode as ::unity::IlType>::il_type()];
97            ::unity::lookup::method_info_on_class_with_signature(
98                <FunctionDefinitionStatement as ::unity::ClassIdentity>::class(),
99                "SetMethod",
100                1,
101                param_types,
102                false,
103            )
104        });
105        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
106            match &*METHOD {
107                ::core::result::Result::Ok(mi) => *mi,
108                ::core::result::Result::Err(e) => {
109                    panic!(
110                        "method lookup failed: {}
111::{}
112: {}
113",
114                        <FunctionDefinitionStatement as ::unity::ClassIdentity>::NAME,
115                        "SetMethod",
116                        e
117                    )
118                },
119            }
120        }
121    }
122    #[doc(hidden)]
123    #[allow(non_snake_case)]
124    pub mod __lookup_set_function {
125        use super::*;
126        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
127            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
128                <crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode as ::unity::IlType>::il_type(),
129                <i32 as ::unity::IlType>::il_type(),
130            ];
131            ::unity::lookup::method_info_on_class_with_signature(
132                <FunctionDefinitionStatement as ::unity::ClassIdentity>::class(),
133                "SetFunction",
134                2,
135                param_types,
136                false,
137            )
138        });
139        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
140            match &*METHOD {
141                ::core::result::Result::Ok(mi) => *mi,
142                ::core::result::Result::Err(e) => {
143                    panic!(
144                        "method lookup failed: {}
145::{}
146: {}
147",
148                        <FunctionDefinitionStatement as ::unity::ClassIdentity>::NAME,
149                        "SetFunction",
150                        e
151                    )
152                },
153            }
154        }
155    }
156}
157
158#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement")]
159pub trait IFunctionDefinitionStatementMethods: IFunctionDefinitionStatement {
160    #[doc = "`.ctor(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext, bool, crate::moon_sharp::interpreter::tree::token::Token)` overload"]
161    fn ctor(
162        self,
163        lcontext: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext>,
164        local: impl ::core::convert::Into<bool>,
165        local_token: impl ::core::convert::Into<crate::moon_sharp::interpreter::tree::token::Token>,
166    ) -> () {
167        unsafe {
168            let __receiver =
169                <FunctionDefinitionStatement as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
170            ::unity::il2cpp_call!(__FunctionDefinitionStatement_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
171(FunctionDefinitionStatement)__receiver,(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext)::core::convert::Into::into(lcontext),(bool)::core::convert::Into::into(local),(crate::moon_sharp::interpreter::tree::token::Token)::core::convert::Into::into(local_token))
172        }
173    }
174    #[doc = "`Compile(crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode)` overload"]
175    fn compile(self, bc: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode>) -> () {
176        unsafe {
177            let __receiver =
178                <FunctionDefinitionStatement as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
179            {
180                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
181                let __vi = *__vt.get(4usize).unwrap_or_else(|| {
182                    panic!(
183                        "unity: virtual slot {}
184 out of range (vtable len {}
185) on the runtime class behind {}
186 (method `{}
187`)",
188                        4usize,
189                        __vt.len(),
190                        <FunctionDefinitionStatement as ::unity::ClassIdentity>::NAME,
191                        "Compile",
192                    )
193                });
194                let __inner: extern "C" fn(
195                    FunctionDefinitionStatement,
196                    crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode,
197                    ::unity::OptionalMethod,
198                ) -> () = ::core::mem::transmute(__vi.method_ptr);
199                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
200                __inner(__receiver, ::core::convert::Into::into(bc), __mi)
201            }
202        }
203    }
204    #[doc = "`SetMethod(crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode)` overload"]
205    fn set_method(self, bc: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode>) -> i32 {
206        unsafe {
207            let __receiver =
208                <FunctionDefinitionStatement as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
209            ::unity::il2cpp_call!(__FunctionDefinitionStatement_unity_raw::__lookup_set_method::get_method_info().method_ptr,i32;
210(FunctionDefinitionStatement)__receiver,(crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode)::core::convert::Into::into(bc))
211        }
212    }
213    #[doc = "`SetFunction(crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode, i32)` overload"]
214    fn set_function(
215        self,
216        bc: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode>,
217        num_pop: impl ::core::convert::Into<i32>,
218    ) -> i32 {
219        unsafe {
220            let __receiver =
221                <FunctionDefinitionStatement as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
222            ::unity::il2cpp_call!(__FunctionDefinitionStatement_unity_raw::__lookup_set_function::get_method_info().method_ptr,i32;
223(FunctionDefinitionStatement)__receiver,(crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode)::core::convert::Into::into(bc),(i32)::core::convert::Into::into(num_pop))
224        }
225    }
226}
227
228#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement")]
229impl<__T: IFunctionDefinitionStatement> IFunctionDefinitionStatementMethods for __T {}
230
231#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement")]
232impl FunctionDefinitionStatement {
233    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
234        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
235    }
236
237    pub fn compile_method_info() -> &'static ::unity::il2cpp::MethodInfo {
238        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
239    }
240
241    pub fn set_method_method_info() -> &'static ::unity::il2cpp::MethodInfo {
242        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
243    }
244
245    pub fn set_function_method_info() -> &'static ::unity::il2cpp::MethodInfo {
246        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
247    }
248}
249
250#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement")]
251impl FunctionDefinitionStatement {
252    #[doc = "Direct (non-virtual) call to `FunctionDefinitionStatement`'s own `Compile`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
253    pub unsafe fn compile(
254        this: impl ::core::convert::Into<::unity::IlInstance>,
255        bc: crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode,
256    ) -> () {
257        let __mi = Self::compile_method_info();
258        let __inner: extern "C" fn(
259            ::unity::IlInstance,
260            crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode,
261            ::unity::OptionalMethod,
262        ) -> () = ::core::mem::transmute(__mi.method_ptr);
263        __inner(this.into(), bc, ::core::option::Option::None)
264    }
265}
266
267#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement")]
268impl FunctionDefinitionStatement {
269    #[doc = "`.ctor(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext, bool, crate::moon_sharp::interpreter::tree::token::Token)` — overload selector"]
270    pub fn new(
271        lcontext: crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext,
272        local: bool,
273        local_token: crate::moon_sharp::interpreter::tree::token::Token,
274    ) -> Self {
275        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
276            panic!(
277                "{}
278::{}
279 failed to instantiate",
280                ::core::stringify!(FunctionDefinitionStatement),
281                ::core::stringify!(new),
282            )
283        });
284        <Self as IFunctionDefinitionStatementMethods>::ctor(this, lcontext, local, local_token);
285        this
286    }
287}
288
289#[cfg(feature = "moon_sharp-interpreter-tree-statements-functiondefinitionstatement")]
290#[doc(hidden)]
291pub mod prelude {
292    pub use super::{FunctionDefinitionStatement, IFunctionDefinitionStatement, IFunctionDefinitionStatementMethods};
293    #[cfg(feature = "moon_sharp-interpreter-tree-nodebase")]
294    pub use crate::moon_sharp::interpreter::tree::nodebase::INodeBaseMethods;
295    #[cfg(feature = "moon_sharp-interpreter-tree-statement")]
296    pub use crate::moon_sharp::interpreter::tree::statement::IStatementMethods;
297    #[cfg(feature = "system-object")]
298    pub use crate::system::object::IObjectMethods;
299    pub use crate::{
300        moon_sharp::interpreter::tree::{nodebase::INodeBase, statement::IStatement},
301        system::object::IObject,
302    };
303}