From 2b212cf4e3bebbcba2f8c64054f00b528db3538d Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sat, 5 Aug 2023 09:09:48 +0200 Subject: [PATCH] proxmox-client: do not require Send for wasm32 target Signed-off-by: Dietmar Maurer --- proxmox-client/src/client.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/proxmox-client/src/client.rs b/proxmox-client/src/client.rs index 1da207f0..510bf169 100644 --- a/proxmox-client/src/client.rs +++ b/proxmox-client/src/client.rs @@ -21,7 +21,10 @@ use crate::{Authentication, Environment, Error, Token}; /// An async [`Client`] requires some kind of async HTTP client implementation. pub trait HttpClient: Send + Sync { type Error: Error; + #[cfg(not(target_arch = "wasm32"))] type Request: Future>, Self::Error>> + Send; + #[cfg(target_arch = "wasm32")] + type Request: Future>, Self::Error>>; fn request(&self, request: Request>) -> Self::Request; } @@ -417,13 +420,15 @@ where /// called again with another cluster node (if available). /// Only if no node responds - or a legitimate HTTP error is produced - will the error be /// returned. - async fn request_retry_loop( + async fn request_retry_loop< + #[cfg(not(target_arch = "wasm32"))] + Fut: Future>, E::Error>> + Send, + #[cfg(target_arch = "wasm32")] + Fut: Future>, E::Error>>, + >( &self, make_request: impl Fn(Uri) -> Fut, - ) -> Result>, E::Error> - where - Fut: Future>, E::Error>> + Send, - { + ) -> Result>, E::Error> { let generation = self.api_urls.generation(); let mut url_index = self.api_urls.index(); let mut retry = None;