Skip to content

Implement IntoFuture trait in services #1189

Closed
@ctaggart

Description

@ctaggart

Add support like microsoft/azure-devops-rust-api#89. When complete, it should be possible to remove into_future() from:

let mut publishers = client
.list_publishers(&location, &subscription_id)
.into_future()
.await?
.into_iter()
.map(|x| x.name)
.collect::<Vec<_>>();
publishers.sort();

If you try to remove it right now, you get:

PS C:\Users\cataggar\io\azure-sdk-for-rust\services\mgmt\compute> cargo check --examples
    Checking azure_mgmt_compute v0.9.0 (C:\Users\cataggar\io\azure-sdk-for-rust\services\mgmt\compute)
error[E0277]: `azure_mgmt_compute::virtual_machine_images::list_publishers::RequestBuilder` is not a future
  --> mgmt\compute\examples\list_free_linux_images.rs:26:54
   |
26 |           .list_publishers(&location, &subscription_id)
   |  ______________________________________________________^
27 | |         .await?
   | |______________^ `azure_mgmt_compute::virtual_machine_images::list_publishers::RequestBuilder` is not a future
   |
   = help: the trait `Future` is not implemented for `azure_mgmt_compute::virtual_machine_images::list_publishers::RequestBuilder`
   = note: azure_mgmt_compute::virtual_machine_images::list_publishers::RequestBuilder must be a future or must implement `IntoFuture` to be awaited
   = note: required because of the requirements on the impl of `IntoFuture` for `azure_mgmt_compute::virtual_machine_images::list_publishers::RequestBuilder`
help: remove the `.await`
   |
26 -         .list_publishers(&location, &subscription_id) 
26 +         .list_publishers(&location, &subscription_id)?
   |

For more information about this error, try `rustc --explain E0277`.
error: could not compile `azure_mgmt_compute` due to previous error

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions