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