Skip to content

Commit

Permalink
bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
kennykerr committed Dec 14, 2023
1 parent 4f2d08d commit b905279
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
struct StockIterable<T>
where
T: ::windows_core::RuntimeType + 'static,
<T as ::windows_core::Type<T>>::Default: Clone,
T::Default: Clone,
{
values: Vec<T::Default>,
}

impl<T> IIterable_Impl<T> for StockIterable<T>
where
T: ::windows_core::RuntimeType,
<T as ::windows_core::Type<T>>::Default: Clone,
T::Default: Clone,
{
fn First(&self) -> ::windows_core::Result<IIterator<T>> {
unsafe {
Expand All @@ -29,7 +29,7 @@ where
struct StockIterator<T>
where
T: ::windows_core::RuntimeType + 'static,
<T as ::windows_core::Type<T>>::Default: Clone,
T::Default: Clone,
{
owner: IIterable<T>,
current: ::std::sync::atomic::AtomicUsize,
Expand All @@ -38,7 +38,7 @@ where
impl<T> IIterator_Impl<T> for StockIterator<T>
where
T: ::windows_core::RuntimeType,
<T as ::windows_core::Type<T>>::Default: Clone,
T::Default: Clone,
{
fn Current(&self) -> ::windows_core::Result<T> {
let owner: &StockIterable<T> = unsafe { ::windows_core::AsImpl::as_impl(&self.owner) };
Expand Down Expand Up @@ -86,7 +86,7 @@ where
impl<T> ::core::convert::TryFrom<Vec<T::Default>> for IIterable<T>
where
T: ::windows_core::RuntimeType,
<T as ::windows_core::Type<T>>::Default: Clone,
T::Default: Clone,
{
type Error = ::windows_core::Error;
fn try_from(values: Vec<T::Default>) -> ::windows_core::Result<Self> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ struct StockMapView<K, V>
where
K: ::windows_core::RuntimeType + 'static,
V: ::windows_core::RuntimeType + 'static,
<K as ::windows_core::Type<K>>::Default: Clone + Ord,
<V as ::windows_core::Type<V>>::Default: Clone,
K::Default: Clone + Ord,
V::Default: Clone,
{
map: std::collections::BTreeMap<K::Default, V::Default>,
}
Expand All @@ -13,8 +13,8 @@ impl<K, V> IIterable_Impl<IKeyValuePair<K, V>> for StockMapView<K, V>
where
K: ::windows_core::RuntimeType,
V: ::windows_core::RuntimeType,
<K as ::windows_core::Type<K>>::Default: Clone + Ord,
<V as ::windows_core::Type<V>>::Default: Clone,
K::Default: Clone + Ord,
V::Default: Clone,
{
fn First(&self) -> ::windows_core::Result<IIterator<IKeyValuePair<K, V>>> {
unsafe {
Expand All @@ -33,8 +33,8 @@ impl<K, V> IMapView_Impl<K, V> for StockMapView<K, V>
where
K: ::windows_core::RuntimeType,
V: ::windows_core::RuntimeType,
<K as ::windows_core::Type<K>>::Default: Clone + Ord,
<V as ::windows_core::Type<V>>::Default: Clone,
K::Default: Clone + Ord,
V::Default: Clone,
{
fn Lookup(&self, key: &K::Default) -> ::windows_core::Result<V> {
let value = self
Expand Down Expand Up @@ -65,8 +65,8 @@ struct StockMapViewIterator<'a, K, V>
where
K: ::windows_core::RuntimeType + 'static,
V: ::windows_core::RuntimeType + 'static,
<K as ::windows_core::Type<K>>::Default: Clone + Ord,
<V as ::windows_core::Type<V>>::Default: Clone,
K::Default: Clone + Ord,
V::Default: Clone,
{
_owner: IIterable<IKeyValuePair<K, V>>,
current: ::std::sync::RwLock<std::collections::btree_map::Iter<'a, K::Default, V::Default>>,
Expand All @@ -76,8 +76,8 @@ impl<'a, K, V> IIterator_Impl<IKeyValuePair<K, V>> for StockMapViewIterator<'a,
where
K: ::windows_core::RuntimeType,
V: ::windows_core::RuntimeType,
<K as ::windows_core::Type<K>>::Default: Clone + Ord,
<V as ::windows_core::Type<V>>::Default: Clone,
K::Default: Clone + Ord,
V::Default: Clone,
{
fn Current(&self) -> ::windows_core::Result<IKeyValuePair<K, V>> {
let mut current = self.current.read().unwrap().clone().peekable();
Expand Down Expand Up @@ -134,8 +134,8 @@ struct StockKeyValuePair<K, V>
where
K: ::windows_core::RuntimeType + 'static,
V: ::windows_core::RuntimeType + 'static,
<K as ::windows_core::Type<K>>::Default: Clone,
<V as ::windows_core::Type<V>>::Default: Clone,
K::Default: Clone,
V::Default: Clone,
{
key: K::Default,
value: V::Default,
Expand All @@ -145,8 +145,8 @@ impl<K, V> IKeyValuePair_Impl<K, V> for StockKeyValuePair<K, V>
where
K: ::windows_core::RuntimeType,
V: ::windows_core::RuntimeType,
<K as ::windows_core::Type<K>>::Default: Clone,
<V as ::windows_core::Type<V>>::Default: Clone,
K::Default: Clone,
V::Default: Clone,
{
fn Key(&self) -> ::windows_core::Result<K> {
K::from_default(&self.key)
Expand All @@ -161,8 +161,8 @@ impl<K, V> ::core::convert::TryFrom<std::collections::BTreeMap<K::Default, V::De
where
K: ::windows_core::RuntimeType,
V: ::windows_core::RuntimeType,
<K as ::windows_core::Type<K>>::Default: Clone + Ord,
<V as ::windows_core::Type<V>>::Default: Clone,
K::Default: Clone + Ord,
V::Default: Clone,
{
type Error = ::windows_core::Error;
fn try_from(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
struct StockVectorView<T>
where
T: ::windows_core::RuntimeType + 'static,
<T as ::windows_core::Type<T>>::Default: Clone + PartialEq,
T::Default: Clone + PartialEq,
{
values: Vec<T::Default>,
}

impl<T> IIterable_Impl<T> for StockVectorView<T>
where
T: ::windows_core::RuntimeType,
<T as ::windows_core::Type<T>>::Default: Clone + PartialEq,
T::Default: Clone + PartialEq,
{
fn First(&self) -> ::windows_core::Result<IIterator<T>> {
unsafe {
Expand All @@ -28,7 +28,7 @@ where
impl<T> IVectorView_Impl<T> for StockVectorView<T>
where
T: ::windows_core::RuntimeType,
<T as ::windows_core::Type<T>>::Default: Clone + PartialEq,
T::Default: Clone + PartialEq,
{
fn GetAt(&self, index: u32) -> ::windows_core::Result<T> {
let item = self
Expand Down Expand Up @@ -65,7 +65,7 @@ where
struct StockVectorViewIterator<T>
where
T: ::windows_core::RuntimeType + 'static,
<T as ::windows_core::Type<T>>::Default: Clone + PartialEq,
T::Default: Clone + PartialEq,
{
owner: IIterable<T>,
current: ::std::sync::atomic::AtomicUsize,
Expand All @@ -74,7 +74,7 @@ where
impl<T> IIterator_Impl<T> for StockVectorViewIterator<T>
where
T: ::windows_core::RuntimeType,
<T as ::windows_core::Type<T>>::Default: Clone + PartialEq,
T::Default: Clone + PartialEq,
{
fn Current(&self) -> ::windows_core::Result<T> {
let owner: &StockVectorView<T> = unsafe { ::windows_core::AsImpl::as_impl(&self.owner) };
Expand Down Expand Up @@ -122,7 +122,7 @@ where
impl<T> ::core::convert::TryFrom<Vec<T::Default>> for IVectorView<T>
where
T: ::windows_core::RuntimeType,
<T as ::windows_core::Type<T>>::Default: Clone + PartialEq,
T::Default: Clone + PartialEq,
{
type Error = ::windows_core::Error;
fn try_from(values: Vec<T::Default>) -> ::windows_core::Result<Self> {
Expand Down
4 changes: 2 additions & 2 deletions crates/libs/bindgen/src/rust/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ impl Writer {
};

quote! {
.push_other(<#g as ::windows_core::RuntimeType>::SIGNATURE)
.push_other(#g::SIGNATURE)
#semi
}
});
Expand Down Expand Up @@ -900,7 +900,7 @@ impl Writer {
quote! { result__ as *mut _ as *mut _, }
}
metadata::SignatureKind::Query(query) | metadata::SignatureKind::QueryOptional(query) if query.guid == position => {
quote! { &<T as ::windows_core::ComInterface>::IID, }
quote! { &T::IID, }
}
_ => {
let name = self.param_name(param.def);
Expand Down

0 comments on commit b905279

Please sign in to comment.