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;