engage/generated/system/collections/generic/
stack_1.rs1#[cfg(feature = "system-collections-generic-stack_1-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::{
9 object::{IObject, Object},
10 valuetype::{IValueType, ValueType},
11 };
12
13 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/collections/generic/stack_1/Stack_1.md"))]
14 #[::unity::class(namespace = "System.Collections.Generic", name = "Stack`1")]
15 #[parent(crate::system::object::Object)]
16 pub struct Stack_1<T0: ::unity::ClassIdentity> {
17 #[rename(name = "_array")]
18 pub array: ::unity::Array<T0>,
19 #[rename(name = "_size")]
20 pub size: i32,
21 #[rename(name = "_version")]
22 pub version: i32,
23 #[rename(name = "_syncRoot")]
24 pub sync_root: ::unity::IlInstance,
25 #[static_field]
26 #[rename(name = "DefaultCapacity")]
27 pub default_capacity: i32,
28 }
29
30 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/collections/generic/stack_1/Stack_1_Enumerator.md"))]
31 #[repr(C)]
32 #[derive(::core::clone::Clone, ::core::marker::Copy)]
33 pub struct Stack_1_Enumerator<T0> {
34 pub _phantom: ::core::marker::PhantomData<(T0,)>,
35 }
36 impl<T0: ::unity::ClassIdentity> ::unity::ClassIdentity for Stack_1_Enumerator<T0> {
37 const NAME: &'static str = "Stack`1.Enumerator";
38 const NAMESPACE: &'static str = "System.Collections.Generic";
39
40 fn class() -> ::unity::Class {
41 static CACHE: ::std::sync::OnceLock<::unity::Class> = ::std::sync::OnceLock::new();
42 *CACHE.get_or_init(|| {
43 ::unity::Class::lookup(Self::NAMESPACE, Self::NAME)
44 .make_generic(&[<T0 as ::unity::ClassIdentity>::class()])
45 .expect("generic instantiation")
46 })
47 }
48 }
49 impl<T0: ::unity::ClassIdentity> ::unity::IlType for Stack_1_Enumerator<T0> {
50 fn il_type() -> &'static ::unity::il2cpp::Il2CppType {
51 &<Self as ::unity::ClassIdentity>::class().raw()._1.byval_arg
52 }
53 }
54}
55
56#[cfg(feature = "system-collections-generic-stack_1-types")]
57pub use __types::*;
58
59#[cfg(feature = "system-collections-generic-stack_1")]
60#[::unity::methods]
61impl<T0: ::unity::ClassIdentity> Stack_1<T0> {
62 #[doc = "`.ctor()` overload"]
63 #[method(name = ".ctor", args = 0)]
64 pub fn ctor(self) -> ();
65
66 #[doc = "`.ctor(i32)` overload"]
67 #[method(name = ".ctor", args = 1)]
68 pub fn ctor_2(self, capacity: i32) -> ();
69
70 #[doc = "`get_Count()` overload"]
71 #[method(name = "get_Count", args = 0)]
72 pub fn get_count(self) -> i32;
73
74 #[doc = "`System.Collections.ICollection.get_IsSynchronized()` overload"]
75 #[method(name = "System.Collections.ICollection.get_IsSynchronized", args = 0)]
76 pub fn system_collections_i_collection_get_is_synchronized(self) -> bool;
77
78 #[doc = "`System.Collections.ICollection.get_SyncRoot()` overload"]
79 #[method(name = "System.Collections.ICollection.get_SyncRoot", args = 0)]
80 pub fn system_collections_i_collection_get_sync_root(self) -> crate::system::object::Object;
81
82 #[doc = "`Clear()` overload"]
83 #[method(name = "Clear", args = 0)]
84 pub fn clear(self) -> ();
85
86 #[doc = "`Contains(T0)` overload"]
87 #[method(name = "Contains", args = 1)]
88 pub fn contains(self, item: T0) -> bool;
89
90 #[doc = "`System.Collections.ICollection.CopyTo(::unity::IlInstance, i32)` overload"]
91 #[method(name = "System.Collections.ICollection.CopyTo", args = 2)]
92 pub fn system_collections_i_collection_copy_to(self, array: ::unity::IlInstance, array_index: i32) -> ();
93
94 #[doc = "`GetEnumerator()` overload"]
95 #[method(name = "GetEnumerator", args = 0)]
96 pub fn get_enumerator(self) -> crate::system::collections::generic::stack_1::Stack_1_Enumerator<T0>;
97
98 #[doc = "`System.Collections.IEnumerable.GetEnumerator()` overload"]
99 #[method(name = "System.Collections.IEnumerable.GetEnumerator", args = 0)]
100 pub fn system_collections_i_enumerable_get_enumerator(self) -> crate::system::collections::ienumerator::IEnumerator;
101
102 #[doc = "`Peek()` overload"]
103 #[method(name = "Peek", args = 0)]
104 pub fn peek(self) -> T0;
105
106 #[doc = "`Pop()` overload"]
107 #[method(name = "Pop", args = 0)]
108 pub fn pop(self) -> T0;
109
110 #[doc = "`Push(T0)` overload"]
111 #[method(name = "Push", args = 1)]
112 pub fn push(self, item: T0) -> ();
113
114 #[doc = "`ThrowForEmptyStack()` overload"]
115 #[method(name = "ThrowForEmptyStack", args = 0)]
116 pub fn throw_for_empty_stack(self) -> ();
117}
118
119#[cfg(feature = "system-collections-generic-stack_1")]
120impl<T0: ::unity::ClassIdentity> Stack_1<T0> {
121 #[doc = "`.ctor()` — no args"]
122 pub fn new() -> Self {
123 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
124 panic!(
125 "{}
126::{}
127 failed to instantiate",
128 ::core::stringify!(Stack_1),
129 ::core::stringify!(new),
130 )
131 });
132 <Self as IStack_1Methods<T0>>::ctor(this);
133 this
134 }
135
136 #[doc = "`.ctor(i32)` — overload selector"]
137 pub fn new_2(capacity: i32) -> Self {
138 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
139 panic!(
140 "{}
141::{}
142 failed to instantiate",
143 ::core::stringify!(Stack_1),
144 ::core::stringify!(new_2),
145 )
146 });
147 <Self as IStack_1Methods<T0>>::ctor_2(this, capacity);
148 this
149 }
150}
151
152#[cfg(feature = "system-collections-generic-stack_1")]
153#[::unity::methods(value)]
154impl<T0: ::unity::ClassIdentity> Stack_1_Enumerator<T0> {
155 #[doc = "`.ctor(crate::system::collections::generic::stack_1::Stack_1<T0>)` overload"]
156 #[method(name = ".ctor", args = 1)]
157 pub fn ctor(self, stack: crate::system::collections::generic::stack_1::Stack_1<T0>) -> ();
158
159 #[doc = "`Dispose()` overload"]
160 #[method(name = "Dispose", args = 0)]
161 pub fn dispose(self) -> ();
162
163 #[doc = "`MoveNext()` overload"]
164 #[method(name = "MoveNext", args = 0)]
165 pub fn move_next(self) -> bool;
166
167 #[doc = "`get_Current()` overload"]
168 #[method(name = "get_Current", args = 0)]
169 pub fn get_current(self) -> T0;
170
171 #[doc = "`ThrowEnumerationNotStartedOrEnded()` overload"]
172 #[method(name = "ThrowEnumerationNotStartedOrEnded", args = 0)]
173 pub fn throw_enumeration_not_started_or_ended(self) -> ();
174
175 #[doc = "`System.Collections.IEnumerator.get_Current()` overload"]
176 #[method(name = "System.Collections.IEnumerator.get_Current", args = 0)]
177 pub fn system_collections_i_enumerator_get_current(self) -> crate::system::object::Object;
178
179 #[doc = "`System.Collections.IEnumerator.Reset()` overload"]
180 #[method(name = "System.Collections.IEnumerator.Reset", args = 0)]
181 pub fn system_collections_i_enumerator_reset(self) -> ();
182}
183
184#[cfg(feature = "system-collections-generic-stack_1")]
185#[doc(hidden)]
186pub mod prelude {
187 pub use super::{IStack_1, IStack_1Methods, Stack_1, Stack_1_Enumerator};
188 #[cfg(feature = "system-object")]
189 pub use crate::system::object::IObjectMethods;
190 #[cfg(feature = "system-valuetype")]
191 pub use crate::system::valuetype::IValueTypeMethods;
192 pub use crate::system::{object::IObject, valuetype::IValueType};
193}