windows_collections/
bindings.rs

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