Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

futures::Future trait implementation not available for IAsyncOperation<T> in v0.58 for some APIs #3197

Closed
qdot opened this issue Aug 11, 2024 · 5 comments
Labels
question Further information is requested

Comments

@qdot
Copy link

qdot commented Aug 11, 2024

Summary

Trying to update to 0.58 in https://github.com/deviceplug/btleplug, now getting errors on all async calls to the WinRT Bluetooth APIs:

error[E0277]: `IAsyncOperation<GattCommunicationStatus>` is not a future
  --> src\winrtble\ble\characteristic.rs:72:32
   |
72 |         let result = operation.await?;
   |                               -^^^^^
   |                               ||
   |                               |`IAsyncOperation<GattCommunicationStatus>` is not a future
   |                               help: remove the `.await`
   |
   = help: the trait `futures::Future` is not implemented for `IAsyncOperation<GattCommunicationStatus>`, which is required by `IAsyncOperation<GattCommunicationStatus>: std::future::IntoFuture`
   = note: IAsyncOperation<GattCommunicationStatus> must be a future or must implement `IntoFuture` to be awaited
   = note: required for `IAsyncOperation<GattCommunicationStatus>` to implement `std::future::IntoFuture

I looked through the CHANGELOG but it's rather dense for this version update and I'm not sure what I'm missing.

Our last library version was released using v0.52, and updating to v0.57 still seems to work, it's just moving to v0.58 that seems to be causing this issue.

Crate manifest

No response

Crate code

No response

@qdot qdot added the bug Something isn't working label Aug 11, 2024
@kennykerr
Copy link
Collaborator

This was removed in #3142 out of safety concerns, but there is an attempt to bring it back in #3177.

@kennykerr kennykerr added question Further information is requested and removed bug Something isn't working labels Aug 12, 2024
@kennykerr
Copy link
Collaborator

Closing in favor of #342

@makepaddev
Copy link

I have the same problem, is this fixed now somehow? I can't seem to find a clear answer in all the related links. How do i get to call await?

@kennykerr
Copy link
Collaborator

Yes, this has been fixed as of #3213 - there just hasn't been a release of the windows crate with this update.

@makepaddev
Copy link

Ok. I've reverted to 0.56 in the meantime, also in 0.57/0.58 the 'implement' COM macro complains about core any not being available

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants