]> git.proxmox.com Git - rustc.git/blame - vendor/windows/src/Windows/Foundation/Collections/mod.rs
New upstream version 1.70.0+dfsg1
[rustc.git] / vendor / windows / src / Windows / Foundation / Collections / mod.rs
CommitLineData
353b0b11
FG
1#[doc = "*Required features: `\"Foundation_Collections\"`*"]
2#[repr(transparent)]
3pub struct IIterable<T>(::windows::core::IUnknown, ::core::marker::PhantomData<T>)
4where
5 T: ::windows::core::RuntimeType + 'static;
6impl<T: ::windows::core::RuntimeType + 'static> IIterable<T> {
7 pub fn First(&self) -> ::windows::core::Result<IIterator<T>> {
8 let this = self;
9 unsafe {
10 let mut result__ = ::windows::core::zeroed::<IIterator<T>>();
11 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
12 }
13 }
14}
15impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IIterable<T> {}
16impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IIterable<T> {}
17impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IIterable<T> {
18 fn eq(&self, other: &Self) -> bool {
19 self.0 == other.0
20 }
21}
22impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IIterable<T> {}
23impl<T: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IIterable<T> {
24 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
25 f.debug_tuple("IIterable").field(&self.0).finish()
26 }
27}
28impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IIterable<T> {
29 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{faa585ea-6214-4217-afda-7f46de5869b3}").push_slice(b";").push_other(<T as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
30}
31impl<T: ::windows::core::RuntimeType> ::core::iter::IntoIterator for IIterable<T> {
32 type Item = T;
33 type IntoIter = IIterator<Self::Item>;
34 fn into_iter(self) -> Self::IntoIter {
35 ::core::iter::IntoIterator::into_iter(&self)
36 }
37}
38impl<T: ::windows::core::RuntimeType> ::core::iter::IntoIterator for &IIterable<T> {
39 type Item = T;
40 type IntoIter = IIterator<Self::Item>;
41 fn into_iter(self) -> Self::IntoIter {
42 self.First().unwrap()
43 }
44}
45unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IIterable<T> {
46 type Vtable = IIterable_Vtbl<T>;
47}
48impl<T: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IIterable<T> {
49 fn clone(&self) -> Self {
50 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
51 }
52}
53unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IIterable<T> {
54 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
55}
56#[repr(C)]
57#[doc(hidden)]
58pub struct IIterable_Vtbl<T>
59where
60 T: ::windows::core::RuntimeType + 'static,
61{
62 pub base__: ::windows::core::IInspectable_Vtbl,
63 pub First: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
64 pub T: ::core::marker::PhantomData<T>,
65}
66#[doc = "*Required features: `\"Foundation_Collections\"`*"]
67#[repr(transparent)]
68pub struct IIterator<T>(::windows::core::IUnknown, ::core::marker::PhantomData<T>)
69where
70 T: ::windows::core::RuntimeType + 'static;
71impl<T: ::windows::core::RuntimeType + 'static> IIterator<T> {
72 pub fn Current(&self) -> ::windows::core::Result<T> {
73 let this = self;
74 unsafe {
75 let mut result__ = ::windows::core::zeroed::<T>();
76 (::windows::core::Interface::vtable(this).Current)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
77 }
78 }
79 pub fn HasCurrent(&self) -> ::windows::core::Result<bool> {
80 let this = self;
81 unsafe {
82 let mut result__ = ::windows::core::zeroed::<bool>();
83 (::windows::core::Interface::vtable(this).HasCurrent)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
84 }
85 }
86 pub fn MoveNext(&self) -> ::windows::core::Result<bool> {
87 let this = self;
88 unsafe {
89 let mut result__ = ::windows::core::zeroed::<bool>();
90 (::windows::core::Interface::vtable(this).MoveNext)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
91 }
92 }
93 pub fn GetMany(&self, items: &mut [<T as ::windows::core::Type<T>>::Default]) -> ::windows::core::Result<u32> {
94 let this = self;
95 unsafe {
96 let mut result__ = ::windows::core::zeroed::<u32>();
97 (::windows::core::Interface::vtable(this).GetMany)(::windows::core::Interface::as_raw(this), items.len() as u32, ::core::mem::transmute_copy(&items), &mut result__).from_abi(result__)
98 }
99 }
100}
101impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IIterator<T> {}
102impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IIterator<T> {}
103impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IIterator<T> {
104 fn eq(&self, other: &Self) -> bool {
105 self.0 == other.0
106 }
107}
108impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IIterator<T> {}
109impl<T: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IIterator<T> {
110 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
111 f.debug_tuple("IIterator").field(&self.0).finish()
112 }
113}
114impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IIterator<T> {
115 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{6a79e863-4300-459a-9966-cbb660963ee1}").push_slice(b";").push_other(<T as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
116}
117impl<T: ::windows::core::RuntimeType> ::core::iter::Iterator for IIterator<T> {
118 type Item = T;
119 fn next(&mut self) -> ::core::option::Option<Self::Item> {
120 let result = self.Current().ok();
121 if result.is_some() {
122 self.MoveNext().ok()?;
123 }
124 result
125 }
126}
127unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IIterator<T> {
128 type Vtable = IIterator_Vtbl<T>;
129}
130impl<T: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IIterator<T> {
131 fn clone(&self) -> Self {
132 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
133 }
134}
135unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IIterator<T> {
136 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
137}
138#[repr(C)]
139#[doc(hidden)]
140pub struct IIterator_Vtbl<T>
141where
142 T: ::windows::core::RuntimeType + 'static,
143{
144 pub base__: ::windows::core::IInspectable_Vtbl,
145 pub Current: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::windows::core::AbiType<T>) -> ::windows::core::HRESULT,
146 pub HasCurrent: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut bool) -> ::windows::core::HRESULT,
147 pub MoveNext: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut bool) -> ::windows::core::HRESULT,
148 pub GetMany: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, items_array_size: u32, items: *mut ::windows::core::AbiType<T>, result__: *mut u32) -> ::windows::core::HRESULT,
149 pub T: ::core::marker::PhantomData<T>,
150}
151#[doc = "*Required features: `\"Foundation_Collections\"`*"]
152#[repr(transparent)]
153pub struct IKeyValuePair<K, V>(::windows::core::IUnknown, ::core::marker::PhantomData<K>, ::core::marker::PhantomData<V>)
154where
155 K: ::windows::core::RuntimeType + 'static,
156 V: ::windows::core::RuntimeType + 'static;
157impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> IKeyValuePair<K, V> {
158 pub fn Key(&self) -> ::windows::core::Result<K> {
159 let this = self;
160 unsafe {
161 let mut result__ = ::windows::core::zeroed::<K>();
162 (::windows::core::Interface::vtable(this).Key)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
163 }
164 }
165 pub fn Value(&self) -> ::windows::core::Result<V> {
166 let this = self;
167 unsafe {
168 let mut result__ = ::windows::core::zeroed::<V>();
169 (::windows::core::Interface::vtable(this).Value)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
170 }
171 }
172}
173impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IKeyValuePair<K, V> {}
174impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IKeyValuePair<K, V> {}
175impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IKeyValuePair<K, V> {
176 fn eq(&self, other: &Self) -> bool {
177 self.0 == other.0
178 }
179}
180impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IKeyValuePair<K, V> {}
181impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IKeyValuePair<K, V> {
182 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
183 f.debug_tuple("IKeyValuePair").field(&self.0).finish()
184 }
185}
186impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IKeyValuePair<K, V> {
187 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{02b51929-c1c4-4a7e-8940-0312b5c18500}").push_slice(b";").push_other(<K as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b";").push_other(<V as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
188}
189unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IKeyValuePair<K, V> {
190 type Vtable = IKeyValuePair_Vtbl<K, V>;
191}
192impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IKeyValuePair<K, V> {
193 fn clone(&self) -> Self {
194 Self(self.0.clone(), ::core::marker::PhantomData::<K>, ::core::marker::PhantomData::<V>)
195 }
196}
197unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IKeyValuePair<K, V> {
198 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
199}
200#[repr(C)]
201#[doc(hidden)]
202pub struct IKeyValuePair_Vtbl<K, V>
203where
204 K: ::windows::core::RuntimeType + 'static,
205 V: ::windows::core::RuntimeType + 'static,
206{
207 pub base__: ::windows::core::IInspectable_Vtbl,
208 pub Key: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::windows::core::AbiType<K>) -> ::windows::core::HRESULT,
209 pub Value: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::windows::core::AbiType<V>) -> ::windows::core::HRESULT,
210 pub K: ::core::marker::PhantomData<K>,
211 pub V: ::core::marker::PhantomData<V>,
212}
213#[doc = "*Required features: `\"Foundation_Collections\"`*"]
214#[repr(transparent)]
215pub struct IMap<K, V>(::windows::core::IUnknown, ::core::marker::PhantomData<K>, ::core::marker::PhantomData<V>)
216where
217 K: ::windows::core::RuntimeType + 'static,
218 V: ::windows::core::RuntimeType + 'static;
219impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> IMap<K, V> {
220 pub fn Lookup<P0>(&self, key: P0) -> ::windows::core::Result<V>
221 where
222 P0: ::windows::core::IntoParam<K>,
223 {
224 let this = self;
225 unsafe {
226 let mut result__ = ::windows::core::zeroed::<V>();
227 (::windows::core::Interface::vtable(this).Lookup)(::windows::core::Interface::as_raw(this), key.into_param().abi(), &mut result__).from_abi(result__)
228 }
229 }
230 pub fn Size(&self) -> ::windows::core::Result<u32> {
231 let this = self;
232 unsafe {
233 let mut result__ = ::windows::core::zeroed::<u32>();
234 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
235 }
236 }
237 pub fn HasKey<P0>(&self, key: P0) -> ::windows::core::Result<bool>
238 where
239 P0: ::windows::core::IntoParam<K>,
240 {
241 let this = self;
242 unsafe {
243 let mut result__ = ::windows::core::zeroed::<bool>();
244 (::windows::core::Interface::vtable(this).HasKey)(::windows::core::Interface::as_raw(this), key.into_param().abi(), &mut result__).from_abi(result__)
245 }
246 }
247 pub fn GetView(&self) -> ::windows::core::Result<IMapView<K, V>> {
248 let this = self;
249 unsafe {
250 let mut result__ = ::windows::core::zeroed::<IMapView<K, V>>();
251 (::windows::core::Interface::vtable(this).GetView)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
252 }
253 }
254 pub fn Insert<P0, P1>(&self, key: P0, value: P1) -> ::windows::core::Result<bool>
255 where
256 P0: ::windows::core::IntoParam<K>,
257 P1: ::windows::core::IntoParam<V>,
258 {
259 let this = self;
260 unsafe {
261 let mut result__ = ::windows::core::zeroed::<bool>();
262 (::windows::core::Interface::vtable(this).Insert)(::windows::core::Interface::as_raw(this), key.into_param().abi(), value.into_param().abi(), &mut result__).from_abi(result__)
263 }
264 }
265 pub fn Remove<P0>(&self, key: P0) -> ::windows::core::Result<()>
266 where
267 P0: ::windows::core::IntoParam<K>,
268 {
269 let this = self;
270 unsafe { (::windows::core::Interface::vtable(this).Remove)(::windows::core::Interface::as_raw(this), key.into_param().abi()).ok() }
271 }
272 pub fn Clear(&self) -> ::windows::core::Result<()> {
273 let this = self;
274 unsafe { (::windows::core::Interface::vtable(this).Clear)(::windows::core::Interface::as_raw(this)).ok() }
275 }
276 pub fn First(&self) -> ::windows::core::Result<IIterator<IKeyValuePair<K, V>>> {
277 let this = &::windows::core::ComInterface::cast::<IIterable<IKeyValuePair<K, V>>>(self)?;
278 unsafe {
279 let mut result__ = ::windows::core::zeroed::<IIterator<IKeyValuePair<K, V>>>();
280 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
281 }
282 }
283}
284impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IMap<K, V> {}
285impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IMap<K, V> {}
286impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanTryInto<IIterable<IKeyValuePair<K, V>>> for IMap<K, V> {}
287impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IMap<K, V> {
288 fn eq(&self, other: &Self) -> bool {
289 self.0 == other.0
290 }
291}
292impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IMap<K, V> {}
293impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IMap<K, V> {
294 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
295 f.debug_tuple("IMap").field(&self.0).finish()
296 }
297}
298impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IMap<K, V> {
299 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{3c2925fe-8519-45c1-aa79-197b6718c1c1}").push_slice(b";").push_other(<K as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b";").push_other(<V as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
300}
301impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::iter::IntoIterator for IMap<K, V> {
302 type Item = IKeyValuePair<K, V>;
303 type IntoIter = IIterator<Self::Item>;
304 fn into_iter(self) -> Self::IntoIter {
305 ::core::iter::IntoIterator::into_iter(&self)
306 }
307}
308impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::iter::IntoIterator for &IMap<K, V> {
309 type Item = IKeyValuePair<K, V>;
310 type IntoIter = IIterator<Self::Item>;
311 fn into_iter(self) -> Self::IntoIter {
312 self.First().unwrap()
313 }
314}
315unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IMap<K, V> {
316 type Vtable = IMap_Vtbl<K, V>;
317}
318impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IMap<K, V> {
319 fn clone(&self) -> Self {
320 Self(self.0.clone(), ::core::marker::PhantomData::<K>, ::core::marker::PhantomData::<V>)
321 }
322}
323unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IMap<K, V> {
324 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
325}
326#[repr(C)]
327#[doc(hidden)]
328pub struct IMap_Vtbl<K, V>
329where
330 K: ::windows::core::RuntimeType + 'static,
331 V: ::windows::core::RuntimeType + 'static,
332{
333 pub base__: ::windows::core::IInspectable_Vtbl,
334 pub Lookup: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, key: ::windows::core::AbiType<K>, result__: *mut ::windows::core::AbiType<V>) -> ::windows::core::HRESULT,
335 pub Size: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
336 pub HasKey: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, key: ::windows::core::AbiType<K>, result__: *mut bool) -> ::windows::core::HRESULT,
337 pub GetView: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
338 pub Insert: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, key: ::windows::core::AbiType<K>, value: ::windows::core::AbiType<V>, result__: *mut bool) -> ::windows::core::HRESULT,
339 pub Remove: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, key: ::windows::core::AbiType<K>) -> ::windows::core::HRESULT,
340 pub Clear: unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
341 pub K: ::core::marker::PhantomData<K>,
342 pub V: ::core::marker::PhantomData<V>,
343}
344#[doc = "*Required features: `\"Foundation_Collections\"`*"]
345#[repr(transparent)]
346pub struct IMapChangedEventArgs<K>(::windows::core::IUnknown, ::core::marker::PhantomData<K>)
347where
348 K: ::windows::core::RuntimeType + 'static;
349impl<K: ::windows::core::RuntimeType + 'static> IMapChangedEventArgs<K> {
350 pub fn CollectionChange(&self) -> ::windows::core::Result<CollectionChange> {
351 let this = self;
352 unsafe {
353 let mut result__ = ::windows::core::zeroed::<CollectionChange>();
354 (::windows::core::Interface::vtable(this).CollectionChange)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
355 }
356 }
357 pub fn Key(&self) -> ::windows::core::Result<K> {
358 let this = self;
359 unsafe {
360 let mut result__ = ::windows::core::zeroed::<K>();
361 (::windows::core::Interface::vtable(this).Key)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
362 }
363 }
364}
365impl<K: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IMapChangedEventArgs<K> {}
366impl<K: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IMapChangedEventArgs<K> {}
367impl<K: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IMapChangedEventArgs<K> {
368 fn eq(&self, other: &Self) -> bool {
369 self.0 == other.0
370 }
371}
372impl<K: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IMapChangedEventArgs<K> {}
373impl<K: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IMapChangedEventArgs<K> {
374 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
375 f.debug_tuple("IMapChangedEventArgs").field(&self.0).finish()
376 }
377}
378impl<K: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IMapChangedEventArgs<K> {
379 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{9939f4df-050a-4c0f-aa60-77075f9c4777}").push_slice(b";").push_other(<K as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
380}
381unsafe impl<K: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IMapChangedEventArgs<K> {
382 type Vtable = IMapChangedEventArgs_Vtbl<K>;
383}
384impl<K: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IMapChangedEventArgs<K> {
385 fn clone(&self) -> Self {
386 Self(self.0.clone(), ::core::marker::PhantomData::<K>)
387 }
388}
389unsafe impl<K: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IMapChangedEventArgs<K> {
390 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
391}
392#[repr(C)]
393#[doc(hidden)]
394pub struct IMapChangedEventArgs_Vtbl<K>
395where
396 K: ::windows::core::RuntimeType + 'static,
397{
398 pub base__: ::windows::core::IInspectable_Vtbl,
399 pub CollectionChange: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut CollectionChange) -> ::windows::core::HRESULT,
400 pub Key: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut ::windows::core::AbiType<K>) -> ::windows::core::HRESULT,
401 pub K: ::core::marker::PhantomData<K>,
402}
403#[doc = "*Required features: `\"Foundation_Collections\"`*"]
404#[repr(transparent)]
405pub struct IMapView<K, V>(::windows::core::IUnknown, ::core::marker::PhantomData<K>, ::core::marker::PhantomData<V>)
406where
407 K: ::windows::core::RuntimeType + 'static,
408 V: ::windows::core::RuntimeType + 'static;
409impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> IMapView<K, V> {
410 pub fn Lookup<P0>(&self, key: P0) -> ::windows::core::Result<V>
411 where
412 P0: ::windows::core::IntoParam<K>,
413 {
414 let this = self;
415 unsafe {
416 let mut result__ = ::windows::core::zeroed::<V>();
417 (::windows::core::Interface::vtable(this).Lookup)(::windows::core::Interface::as_raw(this), key.into_param().abi(), &mut result__).from_abi(result__)
418 }
419 }
420 pub fn Size(&self) -> ::windows::core::Result<u32> {
421 let this = self;
422 unsafe {
423 let mut result__ = ::windows::core::zeroed::<u32>();
424 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
425 }
426 }
427 pub fn HasKey<P0>(&self, key: P0) -> ::windows::core::Result<bool>
428 where
429 P0: ::windows::core::IntoParam<K>,
430 {
431 let this = self;
432 unsafe {
433 let mut result__ = ::windows::core::zeroed::<bool>();
434 (::windows::core::Interface::vtable(this).HasKey)(::windows::core::Interface::as_raw(this), key.into_param().abi(), &mut result__).from_abi(result__)
435 }
436 }
437 pub fn Split(&self, first: &mut ::core::option::Option<IMapView<K, V>>, second: &mut ::core::option::Option<IMapView<K, V>>) -> ::windows::core::Result<()> {
438 let this = self;
439 unsafe { (::windows::core::Interface::vtable(this).Split)(::windows::core::Interface::as_raw(this), first as *mut _ as _, second as *mut _ as _).ok() }
440 }
441 pub fn First(&self) -> ::windows::core::Result<IIterator<IKeyValuePair<K, V>>> {
442 let this = &::windows::core::ComInterface::cast::<IIterable<IKeyValuePair<K, V>>>(self)?;
443 unsafe {
444 let mut result__ = ::windows::core::zeroed::<IIterator<IKeyValuePair<K, V>>>();
445 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
446 }
447 }
448}
449impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IMapView<K, V> {}
450impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IMapView<K, V> {}
451impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanTryInto<IIterable<IKeyValuePair<K, V>>> for IMapView<K, V> {}
452impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IMapView<K, V> {
453 fn eq(&self, other: &Self) -> bool {
454 self.0 == other.0
455 }
456}
457impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IMapView<K, V> {}
458impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IMapView<K, V> {
459 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
460 f.debug_tuple("IMapView").field(&self.0).finish()
461 }
462}
463impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IMapView<K, V> {
464 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{e480ce40-a338-4ada-adcf-272272e48cb9}").push_slice(b";").push_other(<K as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b";").push_other(<V as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
465}
466impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::iter::IntoIterator for IMapView<K, V> {
467 type Item = IKeyValuePair<K, V>;
468 type IntoIter = IIterator<Self::Item>;
469 fn into_iter(self) -> Self::IntoIter {
470 ::core::iter::IntoIterator::into_iter(&self)
471 }
472}
473impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::iter::IntoIterator for &IMapView<K, V> {
474 type Item = IKeyValuePair<K, V>;
475 type IntoIter = IIterator<Self::Item>;
476 fn into_iter(self) -> Self::IntoIter {
477 self.First().unwrap()
478 }
479}
480unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IMapView<K, V> {
481 type Vtable = IMapView_Vtbl<K, V>;
482}
483impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IMapView<K, V> {
484 fn clone(&self) -> Self {
485 Self(self.0.clone(), ::core::marker::PhantomData::<K>, ::core::marker::PhantomData::<V>)
486 }
487}
488unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IMapView<K, V> {
489 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
490}
491#[repr(C)]
492#[doc(hidden)]
493pub struct IMapView_Vtbl<K, V>
494where
495 K: ::windows::core::RuntimeType + 'static,
496 V: ::windows::core::RuntimeType + 'static,
497{
498 pub base__: ::windows::core::IInspectable_Vtbl,
499 pub Lookup: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, key: ::windows::core::AbiType<K>, result__: *mut ::windows::core::AbiType<V>) -> ::windows::core::HRESULT,
500 pub Size: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
501 pub HasKey: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, key: ::windows::core::AbiType<K>, result__: *mut bool) -> ::windows::core::HRESULT,
502 pub Split: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, first: *mut *mut ::core::ffi::c_void, second: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
503 pub K: ::core::marker::PhantomData<K>,
504 pub V: ::core::marker::PhantomData<V>,
505}
506#[doc = "*Required features: `\"Foundation_Collections\"`*"]
507#[repr(transparent)]
508pub struct IObservableMap<K, V>(::windows::core::IUnknown, ::core::marker::PhantomData<K>, ::core::marker::PhantomData<V>)
509where
510 K: ::windows::core::RuntimeType + 'static,
511 V: ::windows::core::RuntimeType + 'static;
512impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> IObservableMap<K, V> {
513 pub fn MapChanged(&self, vhnd: &MapChangedEventHandler<K, V>) -> ::windows::core::Result<super::EventRegistrationToken> {
514 let this = self;
515 unsafe {
516 let mut result__ = ::windows::core::zeroed::<super::EventRegistrationToken>();
517 (::windows::core::Interface::vtable(this).MapChanged)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(vhnd), &mut result__).from_abi(result__)
518 }
519 }
520 pub fn RemoveMapChanged(&self, token: super::EventRegistrationToken) -> ::windows::core::Result<()> {
521 let this = self;
522 unsafe { (::windows::core::Interface::vtable(this).RemoveMapChanged)(::windows::core::Interface::as_raw(this), token).ok() }
523 }
524 pub fn First(&self) -> ::windows::core::Result<IIterator<IKeyValuePair<K, V>>> {
525 let this = &::windows::core::ComInterface::cast::<IIterable<IKeyValuePair<K, V>>>(self)?;
526 unsafe {
527 let mut result__ = ::windows::core::zeroed::<IIterator<IKeyValuePair<K, V>>>();
528 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
529 }
530 }
531 pub fn Lookup<P0>(&self, key: P0) -> ::windows::core::Result<V>
532 where
533 P0: ::windows::core::IntoParam<K>,
534 {
535 let this = &::windows::core::ComInterface::cast::<IMap<K, V>>(self)?;
536 unsafe {
537 let mut result__ = ::windows::core::zeroed::<V>();
538 (::windows::core::Interface::vtable(this).Lookup)(::windows::core::Interface::as_raw(this), key.into_param().abi(), &mut result__).from_abi(result__)
539 }
540 }
541 pub fn Size(&self) -> ::windows::core::Result<u32> {
542 let this = &::windows::core::ComInterface::cast::<IMap<K, V>>(self)?;
543 unsafe {
544 let mut result__ = ::windows::core::zeroed::<u32>();
545 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
546 }
547 }
548 pub fn HasKey<P0>(&self, key: P0) -> ::windows::core::Result<bool>
549 where
550 P0: ::windows::core::IntoParam<K>,
551 {
552 let this = &::windows::core::ComInterface::cast::<IMap<K, V>>(self)?;
553 unsafe {
554 let mut result__ = ::windows::core::zeroed::<bool>();
555 (::windows::core::Interface::vtable(this).HasKey)(::windows::core::Interface::as_raw(this), key.into_param().abi(), &mut result__).from_abi(result__)
556 }
557 }
558 pub fn GetView(&self) -> ::windows::core::Result<IMapView<K, V>> {
559 let this = &::windows::core::ComInterface::cast::<IMap<K, V>>(self)?;
560 unsafe {
561 let mut result__ = ::windows::core::zeroed::<IMapView<K, V>>();
562 (::windows::core::Interface::vtable(this).GetView)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
563 }
564 }
565 pub fn Insert<P0, P1>(&self, key: P0, value: P1) -> ::windows::core::Result<bool>
566 where
567 P0: ::windows::core::IntoParam<K>,
568 P1: ::windows::core::IntoParam<V>,
569 {
570 let this = &::windows::core::ComInterface::cast::<IMap<K, V>>(self)?;
571 unsafe {
572 let mut result__ = ::windows::core::zeroed::<bool>();
573 (::windows::core::Interface::vtable(this).Insert)(::windows::core::Interface::as_raw(this), key.into_param().abi(), value.into_param().abi(), &mut result__).from_abi(result__)
574 }
575 }
576 pub fn Remove<P0>(&self, key: P0) -> ::windows::core::Result<()>
577 where
578 P0: ::windows::core::IntoParam<K>,
579 {
580 let this = &::windows::core::ComInterface::cast::<IMap<K, V>>(self)?;
581 unsafe { (::windows::core::Interface::vtable(this).Remove)(::windows::core::Interface::as_raw(this), key.into_param().abi()).ok() }
582 }
583 pub fn Clear(&self) -> ::windows::core::Result<()> {
584 let this = &::windows::core::ComInterface::cast::<IMap<K, V>>(self)?;
585 unsafe { (::windows::core::Interface::vtable(this).Clear)(::windows::core::Interface::as_raw(this)).ok() }
586 }
587}
588impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IObservableMap<K, V> {}
589impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IObservableMap<K, V> {}
590impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanTryInto<IIterable<IKeyValuePair<K, V>>> for IObservableMap<K, V> {}
591impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> windows::core::CanTryInto<IMap<K, V>> for IObservableMap<K, V> {}
592impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IObservableMap<K, V> {
593 fn eq(&self, other: &Self) -> bool {
594 self.0 == other.0
595 }
596}
597impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IObservableMap<K, V> {}
598impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IObservableMap<K, V> {
599 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
600 f.debug_tuple("IObservableMap").field(&self.0).finish()
601 }
602}
603impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IObservableMap<K, V> {
604 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{65df2bf5-bf39-41b5-aebc-5a9d865e472b}").push_slice(b";").push_other(<K as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b";").push_other(<V as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
605}
606impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::iter::IntoIterator for IObservableMap<K, V> {
607 type Item = IKeyValuePair<K, V>;
608 type IntoIter = IIterator<Self::Item>;
609 fn into_iter(self) -> Self::IntoIter {
610 ::core::iter::IntoIterator::into_iter(&self)
611 }
612}
613impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::iter::IntoIterator for &IObservableMap<K, V> {
614 type Item = IKeyValuePair<K, V>;
615 type IntoIter = IIterator<Self::Item>;
616 fn into_iter(self) -> Self::IntoIter {
617 self.First().unwrap()
618 }
619}
620unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IObservableMap<K, V> {
621 type Vtable = IObservableMap_Vtbl<K, V>;
622}
623impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IObservableMap<K, V> {
624 fn clone(&self) -> Self {
625 Self(self.0.clone(), ::core::marker::PhantomData::<K>, ::core::marker::PhantomData::<V>)
626 }
627}
628unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IObservableMap<K, V> {
629 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
630}
631#[repr(C)]
632#[doc(hidden)]
633pub struct IObservableMap_Vtbl<K, V>
634where
635 K: ::windows::core::RuntimeType + 'static,
636 V: ::windows::core::RuntimeType + 'static,
637{
638 pub base__: ::windows::core::IInspectable_Vtbl,
639 pub MapChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, vhnd: *mut ::core::ffi::c_void, result__: *mut super::EventRegistrationToken) -> ::windows::core::HRESULT,
640 pub RemoveMapChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::EventRegistrationToken) -> ::windows::core::HRESULT,
641 pub K: ::core::marker::PhantomData<K>,
642 pub V: ::core::marker::PhantomData<V>,
643}
644#[doc = "*Required features: `\"Foundation_Collections\"`*"]
645#[repr(transparent)]
646pub struct IObservableVector<T>(::windows::core::IUnknown, ::core::marker::PhantomData<T>)
647where
648 T: ::windows::core::RuntimeType + 'static;
649impl<T: ::windows::core::RuntimeType + 'static> IObservableVector<T> {
650 pub fn VectorChanged(&self, vhnd: &VectorChangedEventHandler<T>) -> ::windows::core::Result<super::EventRegistrationToken> {
651 let this = self;
652 unsafe {
653 let mut result__ = ::windows::core::zeroed::<super::EventRegistrationToken>();
654 (::windows::core::Interface::vtable(this).VectorChanged)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(vhnd), &mut result__).from_abi(result__)
655 }
656 }
657 pub fn RemoveVectorChanged(&self, token: super::EventRegistrationToken) -> ::windows::core::Result<()> {
658 let this = self;
659 unsafe { (::windows::core::Interface::vtable(this).RemoveVectorChanged)(::windows::core::Interface::as_raw(this), token).ok() }
660 }
661 pub fn First(&self) -> ::windows::core::Result<IIterator<T>> {
662 let this = &::windows::core::ComInterface::cast::<IIterable<T>>(self)?;
663 unsafe {
664 let mut result__ = ::windows::core::zeroed::<IIterator<T>>();
665 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
666 }
667 }
668 pub fn GetAt(&self, index: u32) -> ::windows::core::Result<T> {
669 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
670 unsafe {
671 let mut result__ = ::windows::core::zeroed::<T>();
672 (::windows::core::Interface::vtable(this).GetAt)(::windows::core::Interface::as_raw(this), index, &mut result__).from_abi(result__)
673 }
674 }
675 pub fn Size(&self) -> ::windows::core::Result<u32> {
676 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
677 unsafe {
678 let mut result__ = ::windows::core::zeroed::<u32>();
679 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
680 }
681 }
682 pub fn GetView(&self) -> ::windows::core::Result<IVectorView<T>> {
683 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
684 unsafe {
685 let mut result__ = ::windows::core::zeroed::<IVectorView<T>>();
686 (::windows::core::Interface::vtable(this).GetView)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
687 }
688 }
689 pub fn IndexOf<P0>(&self, value: P0, index: &mut u32) -> ::windows::core::Result<bool>
690 where
691 P0: ::windows::core::IntoParam<T>,
692 {
693 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
694 unsafe {
695 let mut result__ = ::windows::core::zeroed::<bool>();
696 (::windows::core::Interface::vtable(this).IndexOf)(::windows::core::Interface::as_raw(this), value.into_param().abi(), index, &mut result__).from_abi(result__)
697 }
698 }
699 pub fn SetAt<P0>(&self, index: u32, value: P0) -> ::windows::core::Result<()>
700 where
701 P0: ::windows::core::IntoParam<T>,
702 {
703 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
704 unsafe { (::windows::core::Interface::vtable(this).SetAt)(::windows::core::Interface::as_raw(this), index, value.into_param().abi()).ok() }
705 }
706 pub fn InsertAt<P0>(&self, index: u32, value: P0) -> ::windows::core::Result<()>
707 where
708 P0: ::windows::core::IntoParam<T>,
709 {
710 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
711 unsafe { (::windows::core::Interface::vtable(this).InsertAt)(::windows::core::Interface::as_raw(this), index, value.into_param().abi()).ok() }
712 }
713 pub fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
714 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
715 unsafe { (::windows::core::Interface::vtable(this).RemoveAt)(::windows::core::Interface::as_raw(this), index).ok() }
716 }
717 pub fn Append<P0>(&self, value: P0) -> ::windows::core::Result<()>
718 where
719 P0: ::windows::core::IntoParam<T>,
720 {
721 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
722 unsafe { (::windows::core::Interface::vtable(this).Append)(::windows::core::Interface::as_raw(this), value.into_param().abi()).ok() }
723 }
724 pub fn RemoveAtEnd(&self) -> ::windows::core::Result<()> {
725 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
726 unsafe { (::windows::core::Interface::vtable(this).RemoveAtEnd)(::windows::core::Interface::as_raw(this)).ok() }
727 }
728 pub fn Clear(&self) -> ::windows::core::Result<()> {
729 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
730 unsafe { (::windows::core::Interface::vtable(this).Clear)(::windows::core::Interface::as_raw(this)).ok() }
731 }
732 pub fn GetMany(&self, startindex: u32, items: &mut [<T as ::windows::core::Type<T>>::Default]) -> ::windows::core::Result<u32> {
733 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
734 unsafe {
735 let mut result__ = ::windows::core::zeroed::<u32>();
736 (::windows::core::Interface::vtable(this).GetMany)(::windows::core::Interface::as_raw(this), startindex, items.len() as u32, ::core::mem::transmute_copy(&items), &mut result__).from_abi(result__)
737 }
738 }
739 pub fn ReplaceAll(&self, items: &[<T as ::windows::core::Type<T>>::Default]) -> ::windows::core::Result<()> {
740 let this = &::windows::core::ComInterface::cast::<IVector<T>>(self)?;
741 unsafe { (::windows::core::Interface::vtable(this).ReplaceAll)(::windows::core::Interface::as_raw(this), items.len() as u32, ::core::mem::transmute(items.as_ptr())).ok() }
742 }
743}
744impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IObservableVector<T> {}
745impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IObservableVector<T> {}
746impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanTryInto<IIterable<T>> for IObservableVector<T> {}
747impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanTryInto<IVector<T>> for IObservableVector<T> {}
748impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IObservableVector<T> {
749 fn eq(&self, other: &Self) -> bool {
750 self.0 == other.0
751 }
752}
753impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IObservableVector<T> {}
754impl<T: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IObservableVector<T> {
755 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
756 f.debug_tuple("IObservableVector").field(&self.0).finish()
757 }
758}
759impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IObservableVector<T> {
760 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{5917eb53-50b4-4a0d-b309-65862b3f1dbc}").push_slice(b";").push_other(<T as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
761}
762impl<T: ::windows::core::RuntimeType + 'static> ::core::iter::IntoIterator for IObservableVector<T> {
763 type Item = T;
764 type IntoIter = VectorIterator<Self::Item>;
765 fn into_iter(self) -> Self::IntoIter {
766 ::core::iter::IntoIterator::into_iter(&self)
767 }
768}
769impl<T: ::windows::core::RuntimeType + 'static> ::core::iter::IntoIterator for &IObservableVector<T> {
770 type Item = T;
771 type IntoIter = VectorIterator<Self::Item>;
772 fn into_iter(self) -> Self::IntoIter {
773 VectorIterator::new(::windows::core::ComInterface::cast(self).ok())
774 }
775}
776unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IObservableVector<T> {
777 type Vtable = IObservableVector_Vtbl<T>;
778}
779impl<T: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IObservableVector<T> {
780 fn clone(&self) -> Self {
781 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
782 }
783}
784unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IObservableVector<T> {
785 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
786}
787#[repr(C)]
788#[doc(hidden)]
789pub struct IObservableVector_Vtbl<T>
790where
791 T: ::windows::core::RuntimeType + 'static,
792{
793 pub base__: ::windows::core::IInspectable_Vtbl,
794 pub VectorChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, vhnd: *mut ::core::ffi::c_void, result__: *mut super::EventRegistrationToken) -> ::windows::core::HRESULT,
795 pub RemoveVectorChanged: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, token: super::EventRegistrationToken) -> ::windows::core::HRESULT,
796 pub T: ::core::marker::PhantomData<T>,
797}
798#[doc = "*Required features: `\"Foundation_Collections\"`*"]
799#[repr(transparent)]
800pub struct IPropertySet(::windows::core::IUnknown);
801impl IPropertySet {
802 pub fn First(&self) -> ::windows::core::Result<IIterator<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>> {
803 let this = &::windows::core::ComInterface::cast::<IIterable<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>>(self)?;
804 unsafe {
805 let mut result__ = ::windows::core::zeroed::<IIterator<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>>();
806 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
807 }
808 }
809 pub fn Lookup(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<::windows::core::IInspectable> {
810 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
811 unsafe {
812 let mut result__ = ::windows::core::zeroed::<::windows::core::IInspectable>();
813 (::windows::core::Interface::vtable(this).Lookup)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), &mut result__).from_abi(result__)
814 }
815 }
816 pub fn Size(&self) -> ::windows::core::Result<u32> {
817 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
818 unsafe {
819 let mut result__ = ::windows::core::zeroed::<u32>();
820 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
821 }
822 }
823 pub fn HasKey(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<bool> {
824 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
825 unsafe {
826 let mut result__ = ::windows::core::zeroed::<bool>();
827 (::windows::core::Interface::vtable(this).HasKey)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), &mut result__).from_abi(result__)
828 }
829 }
830 pub fn GetView(&self) -> ::windows::core::Result<IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>> {
831 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
832 unsafe {
833 let mut result__ = ::windows::core::zeroed::<IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>>();
834 (::windows::core::Interface::vtable(this).GetView)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
835 }
836 }
837 pub fn Insert<P0>(&self, key: &::windows::core::HSTRING, value: P0) -> ::windows::core::Result<bool>
838 where
839 P0: ::windows::core::IntoParam<::windows::core::IInspectable>,
840 {
841 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
842 unsafe {
843 let mut result__ = ::windows::core::zeroed::<bool>();
844 (::windows::core::Interface::vtable(this).Insert)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), value.into_param().abi(), &mut result__).from_abi(result__)
845 }
846 }
847 pub fn Remove(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<()> {
848 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
849 unsafe { (::windows::core::Interface::vtable(this).Remove)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key)).ok() }
850 }
851 pub fn Clear(&self) -> ::windows::core::Result<()> {
852 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
853 unsafe { (::windows::core::Interface::vtable(this).Clear)(::windows::core::Interface::as_raw(this)).ok() }
854 }
855 pub fn MapChanged(&self, vhnd: &MapChangedEventHandler<::windows::core::HSTRING, ::windows::core::IInspectable>) -> ::windows::core::Result<super::EventRegistrationToken> {
856 let this = &::windows::core::ComInterface::cast::<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
857 unsafe {
858 let mut result__ = ::windows::core::zeroed::<super::EventRegistrationToken>();
859 (::windows::core::Interface::vtable(this).MapChanged)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(vhnd), &mut result__).from_abi(result__)
860 }
861 }
862 pub fn RemoveMapChanged(&self, token: super::EventRegistrationToken) -> ::windows::core::Result<()> {
863 let this = &::windows::core::ComInterface::cast::<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
864 unsafe { (::windows::core::Interface::vtable(this).RemoveMapChanged)(::windows::core::Interface::as_raw(this), token).ok() }
865 }
866}
867::windows::imp::interface_hierarchy!(IPropertySet, ::windows::core::IUnknown, ::windows::core::IInspectable);
868impl windows::core::CanTryInto<IIterable<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>> for IPropertySet {}
869impl windows::core::CanTryInto<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>> for IPropertySet {}
870impl windows::core::CanTryInto<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>> for IPropertySet {}
871impl ::core::cmp::PartialEq for IPropertySet {
872 fn eq(&self, other: &Self) -> bool {
873 self.0 == other.0
874 }
875}
876impl ::core::cmp::Eq for IPropertySet {}
877impl ::core::fmt::Debug for IPropertySet {
878 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
879 f.debug_tuple("IPropertySet").field(&self.0).finish()
880 }
881}
882impl ::windows::core::RuntimeType for IPropertySet {
883 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"{8a43ed9f-f4e6-4421-acf9-1dab2986820c}");
884}
885impl ::core::iter::IntoIterator for IPropertySet {
886 type Item = IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>;
887 type IntoIter = IIterator<Self::Item>;
888 fn into_iter(self) -> Self::IntoIter {
889 ::core::iter::IntoIterator::into_iter(&self)
890 }
891}
892impl ::core::iter::IntoIterator for &IPropertySet {
893 type Item = IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>;
894 type IntoIter = IIterator<Self::Item>;
895 fn into_iter(self) -> Self::IntoIter {
896 self.First().unwrap()
897 }
898}
899unsafe impl ::windows::core::Interface for IPropertySet {
900 type Vtable = IPropertySet_Vtbl;
901}
902impl ::core::clone::Clone for IPropertySet {
903 fn clone(&self) -> Self {
904 Self(self.0.clone())
905 }
906}
907unsafe impl ::windows::core::ComInterface for IPropertySet {
908 const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x8a43ed9f_f4e6_4421_acf9_1dab2986820c);
909}
910#[repr(C)]
911#[doc(hidden)]
912pub struct IPropertySet_Vtbl {
913 pub base__: ::windows::core::IInspectable_Vtbl,
914}
915#[doc = "*Required features: `\"Foundation_Collections\"`*"]
916#[repr(transparent)]
917pub struct IVector<T>(::windows::core::IUnknown, ::core::marker::PhantomData<T>)
918where
919 T: ::windows::core::RuntimeType + 'static;
920impl<T: ::windows::core::RuntimeType + 'static> IVector<T> {
921 pub fn GetAt(&self, index: u32) -> ::windows::core::Result<T> {
922 let this = self;
923 unsafe {
924 let mut result__ = ::windows::core::zeroed::<T>();
925 (::windows::core::Interface::vtable(this).GetAt)(::windows::core::Interface::as_raw(this), index, &mut result__).from_abi(result__)
926 }
927 }
928 pub fn Size(&self) -> ::windows::core::Result<u32> {
929 let this = self;
930 unsafe {
931 let mut result__ = ::windows::core::zeroed::<u32>();
932 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
933 }
934 }
935 pub fn GetView(&self) -> ::windows::core::Result<IVectorView<T>> {
936 let this = self;
937 unsafe {
938 let mut result__ = ::windows::core::zeroed::<IVectorView<T>>();
939 (::windows::core::Interface::vtable(this).GetView)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
940 }
941 }
942 pub fn IndexOf<P0>(&self, value: P0, index: &mut u32) -> ::windows::core::Result<bool>
943 where
944 P0: ::windows::core::IntoParam<T>,
945 {
946 let this = self;
947 unsafe {
948 let mut result__ = ::windows::core::zeroed::<bool>();
949 (::windows::core::Interface::vtable(this).IndexOf)(::windows::core::Interface::as_raw(this), value.into_param().abi(), index, &mut result__).from_abi(result__)
950 }
951 }
952 pub fn SetAt<P0>(&self, index: u32, value: P0) -> ::windows::core::Result<()>
953 where
954 P0: ::windows::core::IntoParam<T>,
955 {
956 let this = self;
957 unsafe { (::windows::core::Interface::vtable(this).SetAt)(::windows::core::Interface::as_raw(this), index, value.into_param().abi()).ok() }
958 }
959 pub fn InsertAt<P0>(&self, index: u32, value: P0) -> ::windows::core::Result<()>
960 where
961 P0: ::windows::core::IntoParam<T>,
962 {
963 let this = self;
964 unsafe { (::windows::core::Interface::vtable(this).InsertAt)(::windows::core::Interface::as_raw(this), index, value.into_param().abi()).ok() }
965 }
966 pub fn RemoveAt(&self, index: u32) -> ::windows::core::Result<()> {
967 let this = self;
968 unsafe { (::windows::core::Interface::vtable(this).RemoveAt)(::windows::core::Interface::as_raw(this), index).ok() }
969 }
970 pub fn Append<P0>(&self, value: P0) -> ::windows::core::Result<()>
971 where
972 P0: ::windows::core::IntoParam<T>,
973 {
974 let this = self;
975 unsafe { (::windows::core::Interface::vtable(this).Append)(::windows::core::Interface::as_raw(this), value.into_param().abi()).ok() }
976 }
977 pub fn RemoveAtEnd(&self) -> ::windows::core::Result<()> {
978 let this = self;
979 unsafe { (::windows::core::Interface::vtable(this).RemoveAtEnd)(::windows::core::Interface::as_raw(this)).ok() }
980 }
981 pub fn Clear(&self) -> ::windows::core::Result<()> {
982 let this = self;
983 unsafe { (::windows::core::Interface::vtable(this).Clear)(::windows::core::Interface::as_raw(this)).ok() }
984 }
985 pub fn GetMany(&self, startindex: u32, items: &mut [<T as ::windows::core::Type<T>>::Default]) -> ::windows::core::Result<u32> {
986 let this = self;
987 unsafe {
988 let mut result__ = ::windows::core::zeroed::<u32>();
989 (::windows::core::Interface::vtable(this).GetMany)(::windows::core::Interface::as_raw(this), startindex, items.len() as u32, ::core::mem::transmute_copy(&items), &mut result__).from_abi(result__)
990 }
991 }
992 pub fn ReplaceAll(&self, items: &[<T as ::windows::core::Type<T>>::Default]) -> ::windows::core::Result<()> {
993 let this = self;
994 unsafe { (::windows::core::Interface::vtable(this).ReplaceAll)(::windows::core::Interface::as_raw(this), items.len() as u32, ::core::mem::transmute(items.as_ptr())).ok() }
995 }
996 pub fn First(&self) -> ::windows::core::Result<IIterator<T>> {
997 let this = &::windows::core::ComInterface::cast::<IIterable<T>>(self)?;
998 unsafe {
999 let mut result__ = ::windows::core::zeroed::<IIterator<T>>();
1000 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1001 }
1002 }
1003}
1004impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IVector<T> {}
1005impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IVector<T> {}
1006impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanTryInto<IIterable<T>> for IVector<T> {}
1007impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IVector<T> {
1008 fn eq(&self, other: &Self) -> bool {
1009 self.0 == other.0
1010 }
1011}
1012impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IVector<T> {}
1013impl<T: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IVector<T> {
1014 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1015 f.debug_tuple("IVector").field(&self.0).finish()
1016 }
1017}
1018impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IVector<T> {
1019 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{913337e9-11a1-4345-a3a2-4e7f956e222d}").push_slice(b";").push_other(<T as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
1020}
1021pub struct VectorIterator<T: ::windows::core::RuntimeType + 'static> {
1022 vector: ::core::option::Option<IVector<T>>,
1023 current: u32,
1024}
1025impl<T: ::windows::core::RuntimeType> VectorIterator<T> {
1026 pub fn new(vector: ::core::option::Option<IVector<T>>) -> Self {
1027 Self { vector, current: 0 }
1028 }
1029}
1030impl<T: ::windows::core::RuntimeType> ::core::iter::Iterator for VectorIterator<T> {
1031 type Item = T;
1032 fn next(&mut self) -> ::core::option::Option<Self::Item> {
1033 self.vector.as_ref().and_then(|vector| vector.GetAt(self.current).ok()).and_then(|result| {
1034 self.current += 1;
1035 Some(result)
1036 })
1037 }
1038}
1039impl<T: ::windows::core::RuntimeType> ::core::iter::IntoIterator for IVector<T> {
1040 type Item = T;
1041 type IntoIter = VectorIterator<Self::Item>;
1042 fn into_iter(self) -> Self::IntoIter {
1043 ::core::iter::IntoIterator::into_iter(&self)
1044 }
1045}
1046impl<T: ::windows::core::RuntimeType> ::core::iter::IntoIterator for &IVector<T> {
1047 type Item = T;
1048 type IntoIter = VectorIterator<Self::Item>;
1049 fn into_iter(self) -> Self::IntoIter {
1050 VectorIterator::new(::core::option::Option::Some(::core::clone::Clone::clone(self)))
1051 }
1052}
1053unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IVector<T> {
1054 type Vtable = IVector_Vtbl<T>;
1055}
1056impl<T: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IVector<T> {
1057 fn clone(&self) -> Self {
1058 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
1059 }
1060}
1061unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IVector<T> {
1062 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
1063}
1064#[repr(C)]
1065#[doc(hidden)]
1066pub struct IVector_Vtbl<T>
1067where
1068 T: ::windows::core::RuntimeType + 'static,
1069{
1070 pub base__: ::windows::core::IInspectable_Vtbl,
1071 pub GetAt: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, index: u32, result__: *mut ::windows::core::AbiType<T>) -> ::windows::core::HRESULT,
1072 pub Size: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
1073 pub GetView: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
1074 pub IndexOf: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::windows::core::AbiType<T>, index: *mut u32, result__: *mut bool) -> ::windows::core::HRESULT,
1075 pub SetAt: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, index: u32, value: ::windows::core::AbiType<T>) -> ::windows::core::HRESULT,
1076 pub InsertAt: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, index: u32, value: ::windows::core::AbiType<T>) -> ::windows::core::HRESULT,
1077 pub RemoveAt: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, index: u32) -> ::windows::core::HRESULT,
1078 pub Append: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::windows::core::AbiType<T>) -> ::windows::core::HRESULT,
1079 pub RemoveAtEnd: unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
1080 pub Clear: unsafe extern "system" fn(this: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
1081 pub GetMany: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, startindex: u32, items_array_size: u32, items: *mut ::windows::core::AbiType<T>, result__: *mut u32) -> ::windows::core::HRESULT,
1082 pub ReplaceAll: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, items_array_size: u32, items: *const ::windows::core::AbiType<T>) -> ::windows::core::HRESULT,
1083 pub T: ::core::marker::PhantomData<T>,
1084}
1085#[doc = "*Required features: `\"Foundation_Collections\"`*"]
1086#[repr(transparent)]
1087pub struct IVectorChangedEventArgs(::windows::core::IUnknown);
1088impl IVectorChangedEventArgs {
1089 pub fn CollectionChange(&self) -> ::windows::core::Result<CollectionChange> {
1090 let this = self;
1091 unsafe {
1092 let mut result__ = ::windows::core::zeroed::<CollectionChange>();
1093 (::windows::core::Interface::vtable(this).CollectionChange)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1094 }
1095 }
1096 pub fn Index(&self) -> ::windows::core::Result<u32> {
1097 let this = self;
1098 unsafe {
1099 let mut result__ = ::windows::core::zeroed::<u32>();
1100 (::windows::core::Interface::vtable(this).Index)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1101 }
1102 }
1103}
1104::windows::imp::interface_hierarchy!(IVectorChangedEventArgs, ::windows::core::IUnknown, ::windows::core::IInspectable);
1105impl ::core::cmp::PartialEq for IVectorChangedEventArgs {
1106 fn eq(&self, other: &Self) -> bool {
1107 self.0 == other.0
1108 }
1109}
1110impl ::core::cmp::Eq for IVectorChangedEventArgs {}
1111impl ::core::fmt::Debug for IVectorChangedEventArgs {
1112 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1113 f.debug_tuple("IVectorChangedEventArgs").field(&self.0).finish()
1114 }
1115}
1116impl ::windows::core::RuntimeType for IVectorChangedEventArgs {
1117 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"{575933df-34fe-4480-af15-07691f3d5d9b}");
1118}
1119unsafe impl ::windows::core::Interface for IVectorChangedEventArgs {
1120 type Vtable = IVectorChangedEventArgs_Vtbl;
1121}
1122impl ::core::clone::Clone for IVectorChangedEventArgs {
1123 fn clone(&self) -> Self {
1124 Self(self.0.clone())
1125 }
1126}
1127unsafe impl ::windows::core::ComInterface for IVectorChangedEventArgs {
1128 const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x575933df_34fe_4480_af15_07691f3d5d9b);
1129}
1130#[repr(C)]
1131#[doc(hidden)]
1132pub struct IVectorChangedEventArgs_Vtbl {
1133 pub base__: ::windows::core::IInspectable_Vtbl,
1134 pub CollectionChange: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut CollectionChange) -> ::windows::core::HRESULT,
1135 pub Index: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
1136}
1137#[doc = "*Required features: `\"Foundation_Collections\"`*"]
1138#[repr(transparent)]
1139pub struct IVectorView<T>(::windows::core::IUnknown, ::core::marker::PhantomData<T>)
1140where
1141 T: ::windows::core::RuntimeType + 'static;
1142impl<T: ::windows::core::RuntimeType + 'static> IVectorView<T> {
1143 pub fn GetAt(&self, index: u32) -> ::windows::core::Result<T> {
1144 let this = self;
1145 unsafe {
1146 let mut result__ = ::windows::core::zeroed::<T>();
1147 (::windows::core::Interface::vtable(this).GetAt)(::windows::core::Interface::as_raw(this), index, &mut result__).from_abi(result__)
1148 }
1149 }
1150 pub fn Size(&self) -> ::windows::core::Result<u32> {
1151 let this = self;
1152 unsafe {
1153 let mut result__ = ::windows::core::zeroed::<u32>();
1154 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1155 }
1156 }
1157 pub fn IndexOf<P0>(&self, value: P0, index: &mut u32) -> ::windows::core::Result<bool>
1158 where
1159 P0: ::windows::core::IntoParam<T>,
1160 {
1161 let this = self;
1162 unsafe {
1163 let mut result__ = ::windows::core::zeroed::<bool>();
1164 (::windows::core::Interface::vtable(this).IndexOf)(::windows::core::Interface::as_raw(this), value.into_param().abi(), index, &mut result__).from_abi(result__)
1165 }
1166 }
1167 pub fn GetMany(&self, startindex: u32, items: &mut [<T as ::windows::core::Type<T>>::Default]) -> ::windows::core::Result<u32> {
1168 let this = self;
1169 unsafe {
1170 let mut result__ = ::windows::core::zeroed::<u32>();
1171 (::windows::core::Interface::vtable(this).GetMany)(::windows::core::Interface::as_raw(this), startindex, items.len() as u32, ::core::mem::transmute_copy(&items), &mut result__).from_abi(result__)
1172 }
1173 }
1174 pub fn First(&self) -> ::windows::core::Result<IIterator<T>> {
1175 let this = &::windows::core::ComInterface::cast::<IIterable<T>>(self)?;
1176 unsafe {
1177 let mut result__ = ::windows::core::zeroed::<IIterator<T>>();
1178 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1179 }
1180 }
1181}
1182impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IUnknown> for IVectorView<T> {}
1183impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanInto<::windows::core::IInspectable> for IVectorView<T> {}
1184impl<T: ::windows::core::RuntimeType + 'static> windows::core::CanTryInto<IIterable<T>> for IVectorView<T> {}
1185impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for IVectorView<T> {
1186 fn eq(&self, other: &Self) -> bool {
1187 self.0 == other.0
1188 }
1189}
1190impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for IVectorView<T> {}
1191impl<T: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for IVectorView<T> {
1192 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1193 f.debug_tuple("IVectorView").field(&self.0).finish()
1194 }
1195}
1196impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for IVectorView<T> {
1197 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{bbe1fa4c-b0e3-4583-baef-1f1b2e483e56}").push_slice(b";").push_other(<T as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
1198}
1199pub struct VectorViewIterator<T: ::windows::core::RuntimeType + 'static> {
1200 vector: ::core::option::Option<IVectorView<T>>,
1201 current: u32,
1202}
1203impl<T: ::windows::core::RuntimeType> VectorViewIterator<T> {
1204 pub fn new(vector: ::core::option::Option<IVectorView<T>>) -> Self {
1205 Self { vector, current: 0 }
1206 }
1207}
1208impl<T: ::windows::core::RuntimeType> ::core::iter::Iterator for VectorViewIterator<T> {
1209 type Item = T;
1210 fn next(&mut self) -> ::core::option::Option<Self::Item> {
1211 self.vector.as_ref().and_then(|vector| vector.GetAt(self.current).ok()).and_then(|result| {
1212 self.current += 1;
1213 Some(result)
1214 })
1215 }
1216}
1217impl<T: ::windows::core::RuntimeType> ::core::iter::IntoIterator for IVectorView<T> {
1218 type Item = T;
1219 type IntoIter = VectorViewIterator<Self::Item>;
1220 fn into_iter(self) -> Self::IntoIter {
1221 ::core::iter::IntoIterator::into_iter(&self)
1222 }
1223}
1224impl<T: ::windows::core::RuntimeType> ::core::iter::IntoIterator for &IVectorView<T> {
1225 type Item = T;
1226 type IntoIter = VectorViewIterator<Self::Item>;
1227 fn into_iter(self) -> Self::IntoIter {
1228 VectorViewIterator::new(::core::option::Option::Some(::core::clone::Clone::clone(self)))
1229 }
1230}
1231unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for IVectorView<T> {
1232 type Vtable = IVectorView_Vtbl<T>;
1233}
1234impl<T: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for IVectorView<T> {
1235 fn clone(&self) -> Self {
1236 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
1237 }
1238}
1239unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for IVectorView<T> {
1240 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
1241}
1242#[repr(C)]
1243#[doc(hidden)]
1244pub struct IVectorView_Vtbl<T>
1245where
1246 T: ::windows::core::RuntimeType + 'static,
1247{
1248 pub base__: ::windows::core::IInspectable_Vtbl,
1249 pub GetAt: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, index: u32, result__: *mut ::windows::core::AbiType<T>) -> ::windows::core::HRESULT,
1250 pub Size: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, result__: *mut u32) -> ::windows::core::HRESULT,
1251 pub IndexOf: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, value: ::windows::core::AbiType<T>, index: *mut u32, result__: *mut bool) -> ::windows::core::HRESULT,
1252 pub GetMany: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, startindex: u32, items_array_size: u32, items: *mut ::windows::core::AbiType<T>, result__: *mut u32) -> ::windows::core::HRESULT,
1253 pub T: ::core::marker::PhantomData<T>,
1254}
1255#[doc = "*Required features: `\"Foundation_Collections\"`*"]
1256#[repr(transparent)]
1257pub struct PropertySet(::windows::core::IUnknown);
1258impl PropertySet {
1259 pub fn new() -> ::windows::core::Result<Self> {
1260 Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
1261 }
1262 fn IActivationFactory<R, F: FnOnce(&::windows::imp::IGenericFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> {
1263 static SHARED: ::windows::imp::FactoryCache<PropertySet, ::windows::imp::IGenericFactory> = ::windows::imp::FactoryCache::new();
1264 SHARED.call(callback)
1265 }
1266 pub fn First(&self) -> ::windows::core::Result<IIterator<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>> {
1267 let this = &::windows::core::ComInterface::cast::<IIterable<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>>(self)?;
1268 unsafe {
1269 let mut result__ = ::windows::core::zeroed::<IIterator<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>>();
1270 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1271 }
1272 }
1273 pub fn Lookup(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<::windows::core::IInspectable> {
1274 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1275 unsafe {
1276 let mut result__ = ::windows::core::zeroed::<::windows::core::IInspectable>();
1277 (::windows::core::Interface::vtable(this).Lookup)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), &mut result__).from_abi(result__)
1278 }
1279 }
1280 pub fn Size(&self) -> ::windows::core::Result<u32> {
1281 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1282 unsafe {
1283 let mut result__ = ::windows::core::zeroed::<u32>();
1284 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1285 }
1286 }
1287 pub fn HasKey(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<bool> {
1288 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1289 unsafe {
1290 let mut result__ = ::windows::core::zeroed::<bool>();
1291 (::windows::core::Interface::vtable(this).HasKey)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), &mut result__).from_abi(result__)
1292 }
1293 }
1294 pub fn GetView(&self) -> ::windows::core::Result<IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>> {
1295 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1296 unsafe {
1297 let mut result__ = ::windows::core::zeroed::<IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>>();
1298 (::windows::core::Interface::vtable(this).GetView)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1299 }
1300 }
1301 pub fn Insert<P0>(&self, key: &::windows::core::HSTRING, value: P0) -> ::windows::core::Result<bool>
1302 where
1303 P0: ::windows::core::IntoParam<::windows::core::IInspectable>,
1304 {
1305 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1306 unsafe {
1307 let mut result__ = ::windows::core::zeroed::<bool>();
1308 (::windows::core::Interface::vtable(this).Insert)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), value.into_param().abi(), &mut result__).from_abi(result__)
1309 }
1310 }
1311 pub fn Remove(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<()> {
1312 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1313 unsafe { (::windows::core::Interface::vtable(this).Remove)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key)).ok() }
1314 }
1315 pub fn Clear(&self) -> ::windows::core::Result<()> {
1316 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1317 unsafe { (::windows::core::Interface::vtable(this).Clear)(::windows::core::Interface::as_raw(this)).ok() }
1318 }
1319 pub fn MapChanged(&self, vhnd: &MapChangedEventHandler<::windows::core::HSTRING, ::windows::core::IInspectable>) -> ::windows::core::Result<super::EventRegistrationToken> {
1320 let this = &::windows::core::ComInterface::cast::<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1321 unsafe {
1322 let mut result__ = ::windows::core::zeroed::<super::EventRegistrationToken>();
1323 (::windows::core::Interface::vtable(this).MapChanged)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(vhnd), &mut result__).from_abi(result__)
1324 }
1325 }
1326 pub fn RemoveMapChanged(&self, token: super::EventRegistrationToken) -> ::windows::core::Result<()> {
1327 let this = &::windows::core::ComInterface::cast::<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1328 unsafe { (::windows::core::Interface::vtable(this).RemoveMapChanged)(::windows::core::Interface::as_raw(this), token).ok() }
1329 }
1330}
1331impl ::core::cmp::PartialEq for PropertySet {
1332 fn eq(&self, other: &Self) -> bool {
1333 self.0 == other.0
1334 }
1335}
1336impl ::core::cmp::Eq for PropertySet {}
1337impl ::core::fmt::Debug for PropertySet {
1338 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1339 f.debug_tuple("PropertySet").field(&self.0).finish()
1340 }
1341}
1342impl ::windows::core::RuntimeType for PropertySet {
1343 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Foundation.Collections.PropertySet;{8a43ed9f-f4e6-4421-acf9-1dab2986820c})");
1344}
1345impl ::core::clone::Clone for PropertySet {
1346 fn clone(&self) -> Self {
1347 Self(self.0.clone())
1348 }
1349}
1350unsafe impl ::windows::core::Interface for PropertySet {
1351 type Vtable = IPropertySet_Vtbl;
1352}
1353unsafe impl ::windows::core::ComInterface for PropertySet {
1354 const IID: ::windows::core::GUID = <IPropertySet as ::windows::core::ComInterface>::IID;
1355}
1356impl ::windows::core::RuntimeName for PropertySet {
1357 const NAME: &'static str = "Windows.Foundation.Collections.PropertySet";
1358}
1359impl ::core::iter::IntoIterator for PropertySet {
1360 type Item = IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>;
1361 type IntoIter = IIterator<Self::Item>;
1362 fn into_iter(self) -> Self::IntoIter {
1363 ::core::iter::IntoIterator::into_iter(&self)
1364 }
1365}
1366impl ::core::iter::IntoIterator for &PropertySet {
1367 type Item = IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>;
1368 type IntoIter = IIterator<Self::Item>;
1369 fn into_iter(self) -> Self::IntoIter {
1370 self.First().unwrap()
1371 }
1372}
1373::windows::imp::interface_hierarchy!(PropertySet, ::windows::core::IUnknown, ::windows::core::IInspectable);
1374impl ::windows::core::CanTryInto<IIterable<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>> for PropertySet {}
1375impl ::windows::core::CanTryInto<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>> for PropertySet {}
1376impl ::windows::core::CanTryInto<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>> for PropertySet {}
1377impl ::windows::core::CanTryInto<IPropertySet> for PropertySet {}
1378unsafe impl ::core::marker::Send for PropertySet {}
1379unsafe impl ::core::marker::Sync for PropertySet {}
1380#[doc = "*Required features: `\"Foundation_Collections\"`*"]
1381#[repr(transparent)]
1382pub struct StringMap(::windows::core::IUnknown);
1383impl StringMap {
1384 pub fn new() -> ::windows::core::Result<Self> {
1385 Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
1386 }
1387 fn IActivationFactory<R, F: FnOnce(&::windows::imp::IGenericFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> {
1388 static SHARED: ::windows::imp::FactoryCache<StringMap, ::windows::imp::IGenericFactory> = ::windows::imp::FactoryCache::new();
1389 SHARED.call(callback)
1390 }
1391 pub fn First(&self) -> ::windows::core::Result<IIterator<IKeyValuePair<::windows::core::HSTRING, ::windows::core::HSTRING>>> {
1392 let this = &::windows::core::ComInterface::cast::<IIterable<IKeyValuePair<::windows::core::HSTRING, ::windows::core::HSTRING>>>(self)?;
1393 unsafe {
1394 let mut result__ = ::windows::core::zeroed::<IIterator<IKeyValuePair<::windows::core::HSTRING, ::windows::core::HSTRING>>>();
1395 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1396 }
1397 }
1398 pub fn Lookup(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<::windows::core::HSTRING> {
1399 let this = self;
1400 unsafe {
1401 let mut result__ = ::windows::core::zeroed::<::windows::core::HSTRING>();
1402 (::windows::core::Interface::vtable(this).Lookup)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), &mut result__).from_abi(result__)
1403 }
1404 }
1405 pub fn Size(&self) -> ::windows::core::Result<u32> {
1406 let this = self;
1407 unsafe {
1408 let mut result__ = ::windows::core::zeroed::<u32>();
1409 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1410 }
1411 }
1412 pub fn HasKey(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<bool> {
1413 let this = self;
1414 unsafe {
1415 let mut result__ = ::windows::core::zeroed::<bool>();
1416 (::windows::core::Interface::vtable(this).HasKey)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), &mut result__).from_abi(result__)
1417 }
1418 }
1419 pub fn GetView(&self) -> ::windows::core::Result<IMapView<::windows::core::HSTRING, ::windows::core::HSTRING>> {
1420 let this = self;
1421 unsafe {
1422 let mut result__ = ::windows::core::zeroed::<IMapView<::windows::core::HSTRING, ::windows::core::HSTRING>>();
1423 (::windows::core::Interface::vtable(this).GetView)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1424 }
1425 }
1426 pub fn Insert(&self, key: &::windows::core::HSTRING, value: &::windows::core::HSTRING) -> ::windows::core::Result<bool> {
1427 let this = self;
1428 unsafe {
1429 let mut result__ = ::windows::core::zeroed::<bool>();
1430 (::windows::core::Interface::vtable(this).Insert)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), ::core::mem::transmute_copy(value), &mut result__).from_abi(result__)
1431 }
1432 }
1433 pub fn Remove(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<()> {
1434 let this = self;
1435 unsafe { (::windows::core::Interface::vtable(this).Remove)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key)).ok() }
1436 }
1437 pub fn Clear(&self) -> ::windows::core::Result<()> {
1438 let this = self;
1439 unsafe { (::windows::core::Interface::vtable(this).Clear)(::windows::core::Interface::as_raw(this)).ok() }
1440 }
1441 pub fn MapChanged(&self, vhnd: &MapChangedEventHandler<::windows::core::HSTRING, ::windows::core::HSTRING>) -> ::windows::core::Result<super::EventRegistrationToken> {
1442 let this = &::windows::core::ComInterface::cast::<IObservableMap<::windows::core::HSTRING, ::windows::core::HSTRING>>(self)?;
1443 unsafe {
1444 let mut result__ = ::windows::core::zeroed::<super::EventRegistrationToken>();
1445 (::windows::core::Interface::vtable(this).MapChanged)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(vhnd), &mut result__).from_abi(result__)
1446 }
1447 }
1448 pub fn RemoveMapChanged(&self, token: super::EventRegistrationToken) -> ::windows::core::Result<()> {
1449 let this = &::windows::core::ComInterface::cast::<IObservableMap<::windows::core::HSTRING, ::windows::core::HSTRING>>(self)?;
1450 unsafe { (::windows::core::Interface::vtable(this).RemoveMapChanged)(::windows::core::Interface::as_raw(this), token).ok() }
1451 }
1452}
1453impl ::core::cmp::PartialEq for StringMap {
1454 fn eq(&self, other: &Self) -> bool {
1455 self.0 == other.0
1456 }
1457}
1458impl ::core::cmp::Eq for StringMap {}
1459impl ::core::fmt::Debug for StringMap {
1460 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1461 f.debug_tuple("StringMap").field(&self.0).finish()
1462 }
1463}
1464impl ::windows::core::RuntimeType for StringMap {
1465 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Foundation.Collections.StringMap;pinterface({3c2925fe-8519-45c1-aa79-197b6718c1c1};string;string))");
1466}
1467impl ::core::clone::Clone for StringMap {
1468 fn clone(&self) -> Self {
1469 Self(self.0.clone())
1470 }
1471}
1472unsafe impl ::windows::core::Interface for StringMap {
1473 type Vtable = IMap_Vtbl<::windows::core::HSTRING, ::windows::core::HSTRING>;
1474}
1475unsafe impl ::windows::core::ComInterface for StringMap {
1476 const IID: ::windows::core::GUID = <IMap<::windows::core::HSTRING, ::windows::core::HSTRING> as ::windows::core::ComInterface>::IID;
1477}
1478impl ::windows::core::RuntimeName for StringMap {
1479 const NAME: &'static str = "Windows.Foundation.Collections.StringMap";
1480}
1481impl ::core::iter::IntoIterator for StringMap {
1482 type Item = IKeyValuePair<::windows::core::HSTRING, ::windows::core::HSTRING>;
1483 type IntoIter = IIterator<Self::Item>;
1484 fn into_iter(self) -> Self::IntoIter {
1485 ::core::iter::IntoIterator::into_iter(&self)
1486 }
1487}
1488impl ::core::iter::IntoIterator for &StringMap {
1489 type Item = IKeyValuePair<::windows::core::HSTRING, ::windows::core::HSTRING>;
1490 type IntoIter = IIterator<Self::Item>;
1491 fn into_iter(self) -> Self::IntoIter {
1492 self.First().unwrap()
1493 }
1494}
1495::windows::imp::interface_hierarchy!(StringMap, ::windows::core::IUnknown, ::windows::core::IInspectable);
1496impl ::windows::core::CanTryInto<IIterable<IKeyValuePair<::windows::core::HSTRING, ::windows::core::HSTRING>>> for StringMap {}
1497impl ::windows::core::CanTryInto<IMap<::windows::core::HSTRING, ::windows::core::HSTRING>> for StringMap {}
1498impl ::windows::core::CanTryInto<IObservableMap<::windows::core::HSTRING, ::windows::core::HSTRING>> for StringMap {}
1499unsafe impl ::core::marker::Send for StringMap {}
1500unsafe impl ::core::marker::Sync for StringMap {}
1501#[doc = "*Required features: `\"Foundation_Collections\"`*"]
1502#[repr(transparent)]
1503pub struct ValueSet(::windows::core::IUnknown);
1504impl ValueSet {
1505 pub fn new() -> ::windows::core::Result<Self> {
1506 Self::IActivationFactory(|f| f.ActivateInstance::<Self>())
1507 }
1508 fn IActivationFactory<R, F: FnOnce(&::windows::imp::IGenericFactory) -> ::windows::core::Result<R>>(callback: F) -> ::windows::core::Result<R> {
1509 static SHARED: ::windows::imp::FactoryCache<ValueSet, ::windows::imp::IGenericFactory> = ::windows::imp::FactoryCache::new();
1510 SHARED.call(callback)
1511 }
1512 pub fn First(&self) -> ::windows::core::Result<IIterator<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>> {
1513 let this = &::windows::core::ComInterface::cast::<IIterable<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>>(self)?;
1514 unsafe {
1515 let mut result__ = ::windows::core::zeroed::<IIterator<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>>();
1516 (::windows::core::Interface::vtable(this).First)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1517 }
1518 }
1519 pub fn Lookup(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<::windows::core::IInspectable> {
1520 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1521 unsafe {
1522 let mut result__ = ::windows::core::zeroed::<::windows::core::IInspectable>();
1523 (::windows::core::Interface::vtable(this).Lookup)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), &mut result__).from_abi(result__)
1524 }
1525 }
1526 pub fn Size(&self) -> ::windows::core::Result<u32> {
1527 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1528 unsafe {
1529 let mut result__ = ::windows::core::zeroed::<u32>();
1530 (::windows::core::Interface::vtable(this).Size)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1531 }
1532 }
1533 pub fn HasKey(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<bool> {
1534 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1535 unsafe {
1536 let mut result__ = ::windows::core::zeroed::<bool>();
1537 (::windows::core::Interface::vtable(this).HasKey)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), &mut result__).from_abi(result__)
1538 }
1539 }
1540 pub fn GetView(&self) -> ::windows::core::Result<IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>> {
1541 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1542 unsafe {
1543 let mut result__ = ::windows::core::zeroed::<IMapView<::windows::core::HSTRING, ::windows::core::IInspectable>>();
1544 (::windows::core::Interface::vtable(this).GetView)(::windows::core::Interface::as_raw(this), &mut result__).from_abi(result__)
1545 }
1546 }
1547 pub fn Insert<P0>(&self, key: &::windows::core::HSTRING, value: P0) -> ::windows::core::Result<bool>
1548 where
1549 P0: ::windows::core::IntoParam<::windows::core::IInspectable>,
1550 {
1551 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1552 unsafe {
1553 let mut result__ = ::windows::core::zeroed::<bool>();
1554 (::windows::core::Interface::vtable(this).Insert)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key), value.into_param().abi(), &mut result__).from_abi(result__)
1555 }
1556 }
1557 pub fn Remove(&self, key: &::windows::core::HSTRING) -> ::windows::core::Result<()> {
1558 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1559 unsafe { (::windows::core::Interface::vtable(this).Remove)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(key)).ok() }
1560 }
1561 pub fn Clear(&self) -> ::windows::core::Result<()> {
1562 let this = &::windows::core::ComInterface::cast::<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1563 unsafe { (::windows::core::Interface::vtable(this).Clear)(::windows::core::Interface::as_raw(this)).ok() }
1564 }
1565 pub fn MapChanged(&self, vhnd: &MapChangedEventHandler<::windows::core::HSTRING, ::windows::core::IInspectable>) -> ::windows::core::Result<super::EventRegistrationToken> {
1566 let this = &::windows::core::ComInterface::cast::<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1567 unsafe {
1568 let mut result__ = ::windows::core::zeroed::<super::EventRegistrationToken>();
1569 (::windows::core::Interface::vtable(this).MapChanged)(::windows::core::Interface::as_raw(this), ::core::mem::transmute_copy(vhnd), &mut result__).from_abi(result__)
1570 }
1571 }
1572 pub fn RemoveMapChanged(&self, token: super::EventRegistrationToken) -> ::windows::core::Result<()> {
1573 let this = &::windows::core::ComInterface::cast::<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>>(self)?;
1574 unsafe { (::windows::core::Interface::vtable(this).RemoveMapChanged)(::windows::core::Interface::as_raw(this), token).ok() }
1575 }
1576}
1577impl ::core::cmp::PartialEq for ValueSet {
1578 fn eq(&self, other: &Self) -> bool {
1579 self.0 == other.0
1580 }
1581}
1582impl ::core::cmp::Eq for ValueSet {}
1583impl ::core::fmt::Debug for ValueSet {
1584 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1585 f.debug_tuple("ValueSet").field(&self.0).finish()
1586 }
1587}
1588impl ::windows::core::RuntimeType for ValueSet {
1589 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"rc(Windows.Foundation.Collections.ValueSet;{8a43ed9f-f4e6-4421-acf9-1dab2986820c})");
1590}
1591impl ::core::clone::Clone for ValueSet {
1592 fn clone(&self) -> Self {
1593 Self(self.0.clone())
1594 }
1595}
1596unsafe impl ::windows::core::Interface for ValueSet {
1597 type Vtable = IPropertySet_Vtbl;
1598}
1599unsafe impl ::windows::core::ComInterface for ValueSet {
1600 const IID: ::windows::core::GUID = <IPropertySet as ::windows::core::ComInterface>::IID;
1601}
1602impl ::windows::core::RuntimeName for ValueSet {
1603 const NAME: &'static str = "Windows.Foundation.Collections.ValueSet";
1604}
1605impl ::core::iter::IntoIterator for ValueSet {
1606 type Item = IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>;
1607 type IntoIter = IIterator<Self::Item>;
1608 fn into_iter(self) -> Self::IntoIter {
1609 ::core::iter::IntoIterator::into_iter(&self)
1610 }
1611}
1612impl ::core::iter::IntoIterator for &ValueSet {
1613 type Item = IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>;
1614 type IntoIter = IIterator<Self::Item>;
1615 fn into_iter(self) -> Self::IntoIter {
1616 self.First().unwrap()
1617 }
1618}
1619::windows::imp::interface_hierarchy!(ValueSet, ::windows::core::IUnknown, ::windows::core::IInspectable);
1620impl ::windows::core::CanTryInto<IIterable<IKeyValuePair<::windows::core::HSTRING, ::windows::core::IInspectable>>> for ValueSet {}
1621impl ::windows::core::CanTryInto<IMap<::windows::core::HSTRING, ::windows::core::IInspectable>> for ValueSet {}
1622impl ::windows::core::CanTryInto<IObservableMap<::windows::core::HSTRING, ::windows::core::IInspectable>> for ValueSet {}
1623impl ::windows::core::CanTryInto<IPropertySet> for ValueSet {}
1624unsafe impl ::core::marker::Send for ValueSet {}
1625unsafe impl ::core::marker::Sync for ValueSet {}
1626#[doc = "*Required features: `\"Foundation_Collections\"`*"]
1627#[repr(transparent)]
1628#[derive(::core::cmp::PartialEq, ::core::cmp::Eq)]
1629pub struct CollectionChange(pub i32);
1630impl CollectionChange {
1631 pub const Reset: Self = Self(0i32);
1632 pub const ItemInserted: Self = Self(1i32);
1633 pub const ItemRemoved: Self = Self(2i32);
1634 pub const ItemChanged: Self = Self(3i32);
1635}
1636impl ::core::marker::Copy for CollectionChange {}
1637impl ::core::clone::Clone for CollectionChange {
1638 fn clone(&self) -> Self {
1639 *self
1640 }
1641}
1642impl ::core::default::Default for CollectionChange {
1643 fn default() -> Self {
1644 Self(0)
1645 }
1646}
1647impl ::windows::core::TypeKind for CollectionChange {
1648 type TypeKind = ::windows::core::CopyType;
1649}
1650impl ::core::fmt::Debug for CollectionChange {
1651 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1652 f.debug_tuple("CollectionChange").field(&self.0).finish()
1653 }
1654}
1655impl ::windows::core::RuntimeType for CollectionChange {
1656 const SIGNATURE: ::windows::imp::ConstBuffer = ::windows::imp::ConstBuffer::from_slice(b"enum(Windows.Foundation.Collections.CollectionChange;i4)");
1657}
1658#[doc = "*Required features: `\"Foundation_Collections\"`*"]
1659#[repr(transparent)]
1660pub struct MapChangedEventHandler<K, V>(pub ::windows::core::IUnknown, ::core::marker::PhantomData<K>, ::core::marker::PhantomData<V>)
1661where
1662 K: ::windows::core::RuntimeType + 'static,
1663 V: ::windows::core::RuntimeType + 'static;
1664impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> MapChangedEventHandler<K, V> {
1665 pub fn new<F: FnMut(::core::option::Option<&IObservableMap<K, V>>, ::core::option::Option<&IMapChangedEventArgs<K>>) -> ::windows::core::Result<()> + ::core::marker::Send + 'static>(invoke: F) -> Self {
1666 let com = MapChangedEventHandlerBox::<K, V, F> { vtable: &MapChangedEventHandlerBox::<K, V, F>::VTABLE, count: ::windows::imp::RefCount::new(1), invoke };
1667 unsafe { ::core::mem::transmute(::std::boxed::Box::new(com)) }
1668 }
1669 pub fn Invoke<P0, P1>(&self, sender: P0, event: P1) -> ::windows::core::Result<()>
1670 where
1671 P0: ::windows::core::TryIntoParam<IObservableMap<K, V>>,
1672 P1: ::windows::core::TryIntoParam<IMapChangedEventArgs<K>>,
1673 {
1674 let this = self;
1675 unsafe { (::windows::core::Interface::vtable(this).Invoke)(::windows::core::Interface::as_raw(this), sender.try_into_param()?.abi(), event.try_into_param()?.abi()).ok() }
1676 }
1677}
1678#[repr(C)]
1679struct MapChangedEventHandlerBox<K, V, F: FnMut(::core::option::Option<&IObservableMap<K, V>>, ::core::option::Option<&IMapChangedEventArgs<K>>) -> ::windows::core::Result<()> + ::core::marker::Send + 'static>
1680where
1681 K: ::windows::core::RuntimeType + 'static,
1682 V: ::windows::core::RuntimeType + 'static,
1683{
1684 vtable: *const MapChangedEventHandler_Vtbl<K, V>,
1685 invoke: F,
1686 count: ::windows::imp::RefCount,
1687}
1688impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static, F: FnMut(::core::option::Option<&IObservableMap<K, V>>, ::core::option::Option<&IMapChangedEventArgs<K>>) -> ::windows::core::Result<()> + ::core::marker::Send + 'static> MapChangedEventHandlerBox<K, V, F> {
1689 const VTABLE: MapChangedEventHandler_Vtbl<K, V> = MapChangedEventHandler_Vtbl::<K, V> {
1690 base__: ::windows::core::IUnknown_Vtbl { QueryInterface: Self::QueryInterface, AddRef: Self::AddRef, Release: Self::Release },
1691 Invoke: Self::Invoke,
1692 K: ::core::marker::PhantomData::<K>,
1693 V: ::core::marker::PhantomData::<V>,
1694 };
1695 unsafe extern "system" fn QueryInterface(this: *mut ::core::ffi::c_void, iid: &::windows::core::GUID, interface: *mut *const ::core::ffi::c_void) -> ::windows::core::HRESULT {
1696 let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
1697 *interface = if iid == &<MapChangedEventHandler<K, V> as ::windows::core::ComInterface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::ComInterface>::IID || iid == &<::windows::imp::IAgileObject as ::windows::core::ComInterface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() };
1698 if (*interface).is_null() {
1699 ::windows::core::HRESULT(-2147467262)
1700 } else {
1701 (*this).count.add_ref();
1702 ::windows::core::HRESULT(0)
1703 }
1704 }
1705 unsafe extern "system" fn AddRef(this: *mut ::core::ffi::c_void) -> u32 {
1706 let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
1707 (*this).count.add_ref()
1708 }
1709 unsafe extern "system" fn Release(this: *mut ::core::ffi::c_void) -> u32 {
1710 let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
1711 let remaining = (*this).count.release();
1712 if remaining == 0 {
1713 let _ = ::std::boxed::Box::from_raw(this);
1714 }
1715 remaining
1716 }
1717 unsafe extern "system" fn Invoke(this: *mut ::core::ffi::c_void, sender: *mut ::core::ffi::c_void, event: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
1718 let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
1719 ((*this).invoke)(::windows::core::from_raw_borrowed(&sender), ::windows::core::from_raw_borrowed(&event)).into()
1720 }
1721}
1722impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for MapChangedEventHandler<K, V> {
1723 fn eq(&self, other: &Self) -> bool {
1724 self.0 == other.0
1725 }
1726}
1727impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for MapChangedEventHandler<K, V> {}
1728impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for MapChangedEventHandler<K, V> {
1729 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1730 f.debug_tuple("MapChangedEventHandler").field(&self.0).finish()
1731 }
1732}
1733unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for MapChangedEventHandler<K, V> {
1734 type Vtable = MapChangedEventHandler_Vtbl<K, V>;
1735}
1736impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for MapChangedEventHandler<K, V> {
1737 fn clone(&self) -> Self {
1738 Self(self.0.clone(), ::core::marker::PhantomData::<K>, ::core::marker::PhantomData::<V>)
1739 }
1740}
1741unsafe impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for MapChangedEventHandler<K, V> {
1742 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
1743}
1744impl<K: ::windows::core::RuntimeType + 'static, V: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for MapChangedEventHandler<K, V> {
1745 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{179517f3-94ee-41f8-bddc-768a895544f3}").push_slice(b";").push_other(<K as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b";").push_other(<V as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
1746}
1747#[repr(C)]
1748#[doc(hidden)]
1749pub struct MapChangedEventHandler_Vtbl<K, V>
1750where
1751 K: ::windows::core::RuntimeType + 'static,
1752 V: ::windows::core::RuntimeType + 'static,
1753{
1754 pub base__: ::windows::core::IUnknown_Vtbl,
1755 pub Invoke: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, sender: *mut ::core::ffi::c_void, event: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
1756 pub K: ::core::marker::PhantomData<K>,
1757 pub V: ::core::marker::PhantomData<V>,
1758}
1759#[doc = "*Required features: `\"Foundation_Collections\"`*"]
1760#[repr(transparent)]
1761pub struct VectorChangedEventHandler<T>(pub ::windows::core::IUnknown, ::core::marker::PhantomData<T>)
1762where
1763 T: ::windows::core::RuntimeType + 'static;
1764impl<T: ::windows::core::RuntimeType + 'static> VectorChangedEventHandler<T> {
1765 pub fn new<F: FnMut(::core::option::Option<&IObservableVector<T>>, ::core::option::Option<&IVectorChangedEventArgs>) -> ::windows::core::Result<()> + ::core::marker::Send + 'static>(invoke: F) -> Self {
1766 let com = VectorChangedEventHandlerBox::<T, F> { vtable: &VectorChangedEventHandlerBox::<T, F>::VTABLE, count: ::windows::imp::RefCount::new(1), invoke };
1767 unsafe { ::core::mem::transmute(::std::boxed::Box::new(com)) }
1768 }
1769 pub fn Invoke<P0, P1>(&self, sender: P0, event: P1) -> ::windows::core::Result<()>
1770 where
1771 P0: ::windows::core::TryIntoParam<IObservableVector<T>>,
1772 P1: ::windows::core::TryIntoParam<IVectorChangedEventArgs>,
1773 {
1774 let this = self;
1775 unsafe { (::windows::core::Interface::vtable(this).Invoke)(::windows::core::Interface::as_raw(this), sender.try_into_param()?.abi(), event.try_into_param()?.abi()).ok() }
1776 }
1777}
1778#[repr(C)]
1779struct VectorChangedEventHandlerBox<T, F: FnMut(::core::option::Option<&IObservableVector<T>>, ::core::option::Option<&IVectorChangedEventArgs>) -> ::windows::core::Result<()> + ::core::marker::Send + 'static>
1780where
1781 T: ::windows::core::RuntimeType + 'static,
1782{
1783 vtable: *const VectorChangedEventHandler_Vtbl<T>,
1784 invoke: F,
1785 count: ::windows::imp::RefCount,
1786}
1787impl<T: ::windows::core::RuntimeType + 'static, F: FnMut(::core::option::Option<&IObservableVector<T>>, ::core::option::Option<&IVectorChangedEventArgs>) -> ::windows::core::Result<()> + ::core::marker::Send + 'static> VectorChangedEventHandlerBox<T, F> {
1788 const VTABLE: VectorChangedEventHandler_Vtbl<T> = VectorChangedEventHandler_Vtbl::<T> {
1789 base__: ::windows::core::IUnknown_Vtbl { QueryInterface: Self::QueryInterface, AddRef: Self::AddRef, Release: Self::Release },
1790 Invoke: Self::Invoke,
1791 T: ::core::marker::PhantomData::<T>,
1792 };
1793 unsafe extern "system" fn QueryInterface(this: *mut ::core::ffi::c_void, iid: &::windows::core::GUID, interface: *mut *const ::core::ffi::c_void) -> ::windows::core::HRESULT {
1794 let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
1795 *interface = if iid == &<VectorChangedEventHandler<T> as ::windows::core::ComInterface>::IID || iid == &<::windows::core::IUnknown as ::windows::core::ComInterface>::IID || iid == &<::windows::imp::IAgileObject as ::windows::core::ComInterface>::IID { &mut (*this).vtable as *mut _ as _ } else { ::core::ptr::null_mut() };
1796 if (*interface).is_null() {
1797 ::windows::core::HRESULT(-2147467262)
1798 } else {
1799 (*this).count.add_ref();
1800 ::windows::core::HRESULT(0)
1801 }
1802 }
1803 unsafe extern "system" fn AddRef(this: *mut ::core::ffi::c_void) -> u32 {
1804 let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
1805 (*this).count.add_ref()
1806 }
1807 unsafe extern "system" fn Release(this: *mut ::core::ffi::c_void) -> u32 {
1808 let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
1809 let remaining = (*this).count.release();
1810 if remaining == 0 {
1811 let _ = ::std::boxed::Box::from_raw(this);
1812 }
1813 remaining
1814 }
1815 unsafe extern "system" fn Invoke(this: *mut ::core::ffi::c_void, sender: *mut ::core::ffi::c_void, event: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT {
1816 let this = this as *mut *mut ::core::ffi::c_void as *mut Self;
1817 ((*this).invoke)(::windows::core::from_raw_borrowed(&sender), ::windows::core::from_raw_borrowed(&event)).into()
1818 }
1819}
1820impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::PartialEq for VectorChangedEventHandler<T> {
1821 fn eq(&self, other: &Self) -> bool {
1822 self.0 == other.0
1823 }
1824}
1825impl<T: ::windows::core::RuntimeType + 'static> ::core::cmp::Eq for VectorChangedEventHandler<T> {}
1826impl<T: ::windows::core::RuntimeType + 'static> ::core::fmt::Debug for VectorChangedEventHandler<T> {
1827 fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
1828 f.debug_tuple("VectorChangedEventHandler").field(&self.0).finish()
1829 }
1830}
1831unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::Interface for VectorChangedEventHandler<T> {
1832 type Vtable = VectorChangedEventHandler_Vtbl<T>;
1833}
1834impl<T: ::windows::core::RuntimeType + 'static> ::core::clone::Clone for VectorChangedEventHandler<T> {
1835 fn clone(&self) -> Self {
1836 Self(self.0.clone(), ::core::marker::PhantomData::<T>)
1837 }
1838}
1839unsafe impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::ComInterface for VectorChangedEventHandler<T> {
1840 const IID: ::windows::core::GUID = ::windows::core::GUID::from_signature(<Self as ::windows::core::RuntimeType>::SIGNATURE);
1841}
1842impl<T: ::windows::core::RuntimeType + 'static> ::windows::core::RuntimeType for VectorChangedEventHandler<T> {
1843 const SIGNATURE: ::windows::imp::ConstBuffer = { ::windows::imp::ConstBuffer::new().push_slice(b"pinterface(").push_slice(b"{0c051752-9fbf-4c70-aa0c-0e4c82d9a761}").push_slice(b";").push_other(<T as ::windows::core::RuntimeType>::SIGNATURE).push_slice(b")") };
1844}
1845#[repr(C)]
1846#[doc(hidden)]
1847pub struct VectorChangedEventHandler_Vtbl<T>
1848where
1849 T: ::windows::core::RuntimeType + 'static,
1850{
1851 pub base__: ::windows::core::IUnknown_Vtbl,
1852 pub Invoke: unsafe extern "system" fn(this: *mut ::core::ffi::c_void, sender: *mut ::core::ffi::c_void, event: *mut ::core::ffi::c_void) -> ::windows::core::HRESULT,
1853 pub T: ::core::marker::PhantomData<T>,
1854}
1855#[cfg(feature = "implement")]
1856::core::include!("impl.rs");