Skip to content

Commit

Permalink
Add 'Sync' bound to from_response_body, but exclude bounds from wasm32
Browse files Browse the repository at this point in the history
  • Loading branch information
analogrelay authored Sep 19, 2024
1 parent 0391de1 commit 7223f81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sdk/typespec/typespec_client_core/src/http/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ pub trait Model: Sized {
/// For example, a type representing a simple REST API response will want to wait for the entire body to be received and then parse the body.
/// However, a type representing the download of a large file, may not want to do that and instead prepare to stream the body to a file or other destination.
#[cfg(not(target_arch = "wasm32"))]
fn from_response_body(body: ResponseBody) -> impl Future<Output = crate::Result<Self>> + Send;
fn from_response_body(
body: ResponseBody,
) -> impl Future<Output = crate::Result<Self>> + Send + Sync;

#[cfg(target_arch = "wasm32")]
fn from_response_body(body: ResponseBody) -> impl Future<Output = crate::Result<Self>>;
Expand Down

0 comments on commit 7223f81

Please sign in to comment.