From 59d49329bd5a8e717c21afac4c3a76a9c403a5e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 20:26:06 +0000 Subject: [PATCH 1/7] Initial plan From 437edb4da27b70071a1bec4baadea0f42431acce Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 20:41:35 +0000 Subject: [PATCH 2/7] Create wstd-azure crate with basic implementation Co-authored-by: cataggar <87583576+cataggar@users.noreply.github.com> --- Cargo.toml | 6 ++ azure/Cargo.toml | 24 ++++++ azure/src/lib.rs | 208 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 238 insertions(+) create mode 100644 azure/Cargo.toml create mode 100644 azure/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index f066963..81ce7e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,6 +47,7 @@ serde_json.workspace = true members = [ "axum", "axum/macro", + "azure", "macro", "test-programs", ] @@ -70,7 +71,10 @@ authors = [ [workspace.dependencies] anyhow = "1" async-task = "4.7" +async-trait = "0.1" axum = { version = "0.8.6", default-features = false } +azure_core = { version = "0.29", default-features = false } +azure_storage_blobs = { version = "0.21", default-features = false } bytes = "1.10.1" cargo_metadata = "0.22" clap = { version = "4.5.26", features = ["derive"] } @@ -93,11 +97,13 @@ syn = "2.0" test-log = { version = "0.2", features = ["trace"] } test-programs = { path = "test-programs" } tower-service = "0.3.3" +typespec_client_core = { version = "0.8", default-features = false, features = ["http", "json"] } ureq = { version = "3.1", default-features = false, features = ["json"] } wasip2 = "1.0" wstd = { path = ".", version = "=0.6.1" } wstd-axum = { path = "./axum", version = "=0.6.1" } wstd-axum-macro = { path = "./axum/macro", version = "=0.6.1" } +wstd-azure = { path = "./azure", version = "=0.6.1" } wstd-macro = { path = "./macro", version = "=0.6.1" } [package.metadata.docs.rs] diff --git a/azure/Cargo.toml b/azure/Cargo.toml new file mode 100644 index 0000000..c9a7e52 --- /dev/null +++ b/azure/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "wstd-azure" +description = "wstd support for the Azure Rust SDK" +version.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true +keywords.workspace = true +categories.workspace = true +rust-version.workspace = true +authors.workspace = true + +[dependencies] +anyhow.workspace = true +async-trait.workspace = true +bytes.workspace = true +http.workspace = true +typespec_client_core = { workspace = true } +wstd.workspace = true + +[dev-dependencies] +azure_core.workspace = true +azure_storage_blobs.workspace = true +clap.workspace = true diff --git a/azure/src/lib.rs b/azure/src/lib.rs new file mode 100644 index 0000000..32e0456 --- /dev/null +++ b/azure/src/lib.rs @@ -0,0 +1,208 @@ +//! wstd support for the Azure Rust SDK +//! +//! This crate provides support for using the Azure Rust SDK for the `wasm32-wasip2` +//! target using the [`wstd`] crate. +//! +//! In many wasi settings, it's necessary or desirable to use the wasi-http +//! interface to make http requests. Wasi-http interfaces provide an http +//! implementation, including the sockets layer and TLS, outside of the user's +//! component. `wstd` provides user-friendly async Rust interfaces to all of the +//! standardized wasi interfaces, including wasi-http. +//! +//! The Azure Rust SDK, by default, depends on `tokio` and `reqwest`, and makes +//! http requests over sockets (which can be provided as wasi-sockets). Those +//! dependencies may not work correctly under `wasm32-wasip2`, and if they do, +//! they will not use the wasi-http interfaces. To avoid using http over sockets, +//! make sure to set the `default-features = false` setting when depending on any +//! `azure_*` crates in your project. +//! +//! To configure `wstd`'s wasi-http client and async runtime for the Azure Rust SDK, +//! call [`set_wstd_runtime()`] once at the start of your application: +//! +//! ```no_run +//! # use wstd_azure::set_wstd_runtime; +//! set_wstd_runtime().expect("Failed to set runtime"); +//! ``` +//! +//! Then use the Azure SDK as normal. +//! +//! [`wstd`]: https://docs.rs/wstd/latest/wstd + +use async_trait::async_trait; +use std::sync::Arc; +use typespec_client_core::async_runtime::{AsyncRuntime, SpawnedTask, TaskFuture}; +use typespec_client_core::http::{BufResponse, HttpClient, Request}; +use typespec_client_core::time::Duration; +use wstd::http::{Body as WstdBody, Client}; + +/// Set the wstd-based async runtime and HTTP client as the default for the Azure SDK. +/// +/// This should be called once at the start of your application before using any +/// Azure SDK functionality. +/// +/// # Errors +/// +/// Returns an error if the runtime has already been set. +/// +/// # Example +/// +/// ```no_run +/// use wstd_azure::set_wstd_runtime; +/// +/// #[wstd::main] +/// async fn main() -> Result<(), Box> { +/// set_wstd_runtime()?; +/// // Use Azure SDK... +/// Ok(()) +/// } +/// ``` +pub fn set_wstd_runtime() -> typespec_client_core::Result<()> { + typespec_client_core::async_runtime::set_async_runtime(Arc::new(WstdAsyncRuntime)) +} + +/// Get a new wstd-based HTTP client for the Azure SDK. +/// +/// This creates a new HTTP client that uses wstd's wasi-http implementation. +pub fn http_client() -> Arc { + Arc::new(WstdHttpClient::new()) +} + +/// Get a wstd-based async runtime for the Azure SDK. +/// +/// This creates a new async runtime that uses wstd's task spawning and timing. +pub fn async_runtime() -> Arc { + Arc::new(WstdAsyncRuntime) +} + +/// Async runtime implementation using wstd. +#[derive(Debug)] +struct WstdAsyncRuntime; + +impl AsyncRuntime for WstdAsyncRuntime { + fn spawn(&self, f: TaskFuture) -> SpawnedTask { + Box::pin(async move { + wstd::runtime::spawn(f).await; + Ok(()) + }) + } + + fn sleep(&self, duration: Duration) -> TaskFuture { + Box::pin(async move { + // Convert time crate Duration to std Duration to wstd Duration + // time::Duration has whole_seconds() and subsec_nanoseconds() + let secs = duration.whole_seconds() as u64; + let nanos = duration.subsec_nanoseconds() as u32; + let std_duration = std::time::Duration::new(secs, nanos); + wstd::task::sleep(wstd::time::Duration::from(std_duration)).await; + }) + } +} + +/// HTTP client implementation using wstd. +#[derive(Debug)] +struct WstdHttpClient { + client: Client, +} + +impl WstdHttpClient { + fn new() -> Self { + Self { + client: Client::new(), + } + } +} + +#[cfg_attr(target_arch = "wasm32", async_trait(?Send))] +#[cfg_attr(not(target_arch = "wasm32"), async_trait)] +impl HttpClient for WstdHttpClient { + async fn execute_request(&self, request: &Request) -> typespec_client_core::Result { + // Convert the Azure SDK request to a wstd http request + let url = request.url().to_string(); + let method = convert_method(request.method()); + + let mut http_request = http::Request::builder() + .method(method) + .uri(&url); + + // Add headers + for (name, value) in request.headers().iter() { + http_request = http_request.header(name.as_str(), value.as_str()); + } + + // Add body + let body = match request.body() { + typespec_client_core::http::Body::Bytes(bytes) => { + WstdBody::from(bytes.clone()) + } + #[cfg(not(target_arch = "wasm32"))] + typespec_client_core::http::Body::SeekableStream(_) => { + return Err(typespec_client_core::Error::with_message( + typespec_client_core::error::ErrorKind::Other, + "Streaming request bodies are not supported", + )); + } + }; + + let http_request = http_request + .body(body) + .map_err(|e| typespec_client_core::Error::with_message( + typespec_client_core::error::ErrorKind::Other, + format!("Failed to build HTTP request: {}", e), + ))?; + + // Send the request + let response = self.client + .send(http_request) + .await + .map_err(|e| typespec_client_core::Error::with_message( + typespec_client_core::error::ErrorKind::Io, + format!("HTTP request failed: {}", e), + ))?; + + // Convert the response + let status = response.status(); + let headers = convert_headers(response.headers()); + + // Collect the response body into bytes + let mut body = response.into_body(); + let body_bytes = body + .contents() + .await + .map_err(|e| typespec_client_core::Error::with_message( + typespec_client_core::error::ErrorKind::Io, + format!("Failed to read response body: {}", e), + ))?; + + Ok(BufResponse::from_bytes( + typespec_client_core::http::StatusCode::from(status.as_u16()), + headers, + bytes::Bytes::copy_from_slice(body_bytes), + )) + } +} + +fn convert_method(method: typespec_client_core::http::Method) -> http::Method { + use typespec_client_core::http::Method; + match method { + Method::Get => http::Method::GET, + Method::Post => http::Method::POST, + Method::Put => http::Method::PUT, + Method::Delete => http::Method::DELETE, + Method::Head => http::Method::HEAD, + Method::Patch => http::Method::PATCH, + _ => http::Method::GET, // Default fallback for any future methods + } +} + +fn convert_headers(headers: &http::HeaderMap) -> typespec_client_core::http::headers::Headers { + let mut result = typespec_client_core::http::headers::Headers::new(); + for (name, value) in headers.iter() { + if let Ok(value_str) = value.to_str() { + result.insert( + typespec_client_core::http::headers::HeaderName::from(name.to_string()), + typespec_client_core::http::headers::HeaderValue::from(value_str.to_string()), + ); + } + } + result +} From 9b05aa246cd5c707a144434ae34bbb8c878f4ee5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 20:45:08 +0000 Subject: [PATCH 3/7] Add README and example for wstd-azure Co-authored-by: cataggar <87583576+cataggar@users.noreply.github.com> --- azure/README.md | 63 ++++++++++++++++++++++++++++++++++ azure/examples/blob_storage.rs | 51 +++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 azure/README.md create mode 100644 azure/examples/blob_storage.rs diff --git a/azure/README.md b/azure/README.md new file mode 100644 index 0000000..1a424bd --- /dev/null +++ b/azure/README.md @@ -0,0 +1,63 @@ +# wstd-azure: wstd support for the Azure Rust SDK + +This crate provides support for using the Azure Rust SDK for the `wasm32-wasip2` +target using the [`wstd`] crate. + +In many wasi settings, it's necessary or desirable to use the wasi-http +interface to make http requests. Wasi-http interfaces provide an http +implementation, including the sockets layer and TLS, outside of the user's +component. `wstd` provides user-friendly async Rust interfaces to all of the +standardized wasi interfaces, including wasi-http. + +The Azure Rust SDK, by default, depends on `tokio` and `reqwest`, and makes +http requests over sockets (which can be provided as wasi-sockets). Those +dependencies may not work correctly under `wasm32-wasip2`, and if they do, +they will not use the wasi-http interfaces. To avoid using http over sockets, +make sure to set the `default-features = false` setting when depending on any +`azure_*` crates in your project. + +## Usage + +To configure `wstd`'s wasi-http client and async runtime for the Azure Rust SDK, +call `wstd_azure::set_wstd_runtime()` once at the start of your application: + +```rust +use wstd_azure::set_wstd_runtime; + +#[wstd::main] +async fn main() -> Result<(), Box> { + // Set up wstd runtime for Azure SDK + set_wstd_runtime()?; + + // Now use Azure SDK as normal + // ... + + Ok(()) +} +``` + +Alternatively, you can get the runtime and HTTP client separately if you need +more control: + +```rust +use wstd_azure::{async_runtime, http_client}; + +// Get the async runtime +let runtime = async_runtime(); + +// Get the HTTP client +let client = http_client(); +``` + +## Example + +An example Azure Blob Storage client is provided. See the `examples` directory +for a complete working example. + +## Requirements + +- Rust 1.89 or later +- `wasm32-wasip2` target installed +- `wasmtime` or another WASI runtime with wasi-http support + +[`wstd`]: https://docs.rs/wstd/latest/wstd diff --git a/azure/examples/blob_storage.rs b/azure/examples/blob_storage.rs new file mode 100644 index 0000000..5aa5955 --- /dev/null +++ b/azure/examples/blob_storage.rs @@ -0,0 +1,51 @@ +//! Example Azure Blob Storage client running on `wstd` via `wstd_azure` +//! +//! This example demonstrates how to set up the wstd runtime for use with the +//! Azure Rust SDK. The actual Azure SDK client code will depend on which +//! version of the azure_storage_blobs crate you are using. +//! +//! This example *must be compiled in release mode* - in debug mode, the azure +//! sdk's generated code will overflow the maximum permitted wasm locals in +//! a single function. +//! +//! Compile it with: +//! +//! ```sh +//! cargo build -p wstd-azure --target wasm32-wasip2 --release --examples +//! ``` +//! +//! When running this example, you will need Azure credentials provided in environment +//! variables. +//! +//! Run it with: +//! ```sh +//! wasmtime run -Shttp \ +//! --env AZURE_STORAGE_ACCOUNT_NAME \ +//! --env AZURE_STORAGE_ACCESS_KEY \ +//! --dir .::. \ +//! target/wasm32-wasip2/release/examples/blob_storage.wasm +//! ``` + +use anyhow::Result; + +#[wstd::main] +async fn main() -> Result<()> { + // Set up wstd runtime for Azure SDK + // This configures the Azure SDK to use wstd's async runtime and HTTP client + wstd_azure::set_wstd_runtime()?; + + println!("wstd runtime configured for Azure SDK"); + println!(""); + println!("To use the Azure SDK:"); + println!("1. Import the Azure SDK crates you need (e.g., azure_storage_blobs)"); + println!("2. Make sure to use default-features = false for Azure crates"); + println!("3. Create your Azure SDK clients as normal"); + println!("4. The SDK will use wstd's wasi-http implementation automatically"); + + // Example placeholder - actual Azure SDK usage will depend on your version + // and which services you're using. See the Azure SDK documentation at: + // https://github.com/Azure/azure-sdk-for-rust + + Ok(()) +} + From 4f6f87d57d0a361c0696cf51b84da7b50cdcbec4 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 20:47:35 +0000 Subject: [PATCH 4/7] Format code and verify builds Co-authored-by: cataggar <87583576+cataggar@users.noreply.github.com> --- azure/examples/blob_storage.rs | 7 ++--- azure/src/lib.rs | 57 ++++++++++++++++------------------ 2 files changed, 30 insertions(+), 34 deletions(-) diff --git a/azure/examples/blob_storage.rs b/azure/examples/blob_storage.rs index 5aa5955..7067853 100644 --- a/azure/examples/blob_storage.rs +++ b/azure/examples/blob_storage.rs @@ -33,7 +33,7 @@ async fn main() -> Result<()> { // Set up wstd runtime for Azure SDK // This configures the Azure SDK to use wstd's async runtime and HTTP client wstd_azure::set_wstd_runtime()?; - + println!("wstd runtime configured for Azure SDK"); println!(""); println!("To use the Azure SDK:"); @@ -41,11 +41,10 @@ async fn main() -> Result<()> { println!("2. Make sure to use default-features = false for Azure crates"); println!("3. Create your Azure SDK clients as normal"); println!("4. The SDK will use wstd's wasi-http implementation automatically"); - + // Example placeholder - actual Azure SDK usage will depend on your version // and which services you're using. See the Azure SDK documentation at: // https://github.com/Azure/azure-sdk-for-rust - + Ok(()) } - diff --git a/azure/src/lib.rs b/azure/src/lib.rs index 32e0456..1b4fedf 100644 --- a/azure/src/lib.rs +++ b/azure/src/lib.rs @@ -88,7 +88,7 @@ impl AsyncRuntime for WstdAsyncRuntime { fn sleep(&self, duration: Duration) -> TaskFuture { Box::pin(async move { - // Convert time crate Duration to std Duration to wstd Duration + // Convert time crate Duration to std Duration to wstd Duration // time::Duration has whole_seconds() and subsec_nanoseconds() let secs = duration.whole_seconds() as u64; let nanos = duration.subsec_nanoseconds() as u32; @@ -115,25 +115,24 @@ impl WstdHttpClient { #[cfg_attr(target_arch = "wasm32", async_trait(?Send))] #[cfg_attr(not(target_arch = "wasm32"), async_trait)] impl HttpClient for WstdHttpClient { - async fn execute_request(&self, request: &Request) -> typespec_client_core::Result { + async fn execute_request( + &self, + request: &Request, + ) -> typespec_client_core::Result { // Convert the Azure SDK request to a wstd http request let url = request.url().to_string(); let method = convert_method(request.method()); - - let mut http_request = http::Request::builder() - .method(method) - .uri(&url); - + + let mut http_request = http::Request::builder().method(method).uri(&url); + // Add headers for (name, value) in request.headers().iter() { http_request = http_request.header(name.as_str(), value.as_str()); } - + // Add body let body = match request.body() { - typespec_client_core::http::Body::Bytes(bytes) => { - WstdBody::from(bytes.clone()) - } + typespec_client_core::http::Body::Bytes(bytes) => WstdBody::from(bytes.clone()), #[cfg(not(target_arch = "wasm32"))] typespec_client_core::http::Body::SeekableStream(_) => { return Err(typespec_client_core::Error::with_message( @@ -142,37 +141,35 @@ impl HttpClient for WstdHttpClient { )); } }; - - let http_request = http_request - .body(body) - .map_err(|e| typespec_client_core::Error::with_message( + + let http_request = http_request.body(body).map_err(|e| { + typespec_client_core::Error::with_message( typespec_client_core::error::ErrorKind::Other, format!("Failed to build HTTP request: {}", e), - ))?; - + ) + })?; + // Send the request - let response = self.client - .send(http_request) - .await - .map_err(|e| typespec_client_core::Error::with_message( + let response = self.client.send(http_request).await.map_err(|e| { + typespec_client_core::Error::with_message( typespec_client_core::error::ErrorKind::Io, format!("HTTP request failed: {}", e), - ))?; - + ) + })?; + // Convert the response let status = response.status(); let headers = convert_headers(response.headers()); - + // Collect the response body into bytes let mut body = response.into_body(); - let body_bytes = body - .contents() - .await - .map_err(|e| typespec_client_core::Error::with_message( + let body_bytes = body.contents().await.map_err(|e| { + typespec_client_core::Error::with_message( typespec_client_core::error::ErrorKind::Io, format!("Failed to read response body: {}", e), - ))?; - + ) + })?; + Ok(BufResponse::from_bytes( typespec_client_core::http::StatusCode::from(status.as_u16()), headers, From ce959ceea253b0ae9d6c6fc2a2783d3764614e12 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 20:50:46 +0000 Subject: [PATCH 5/7] Address code review feedback Co-authored-by: cataggar <87583576+cataggar@users.noreply.github.com> --- azure/src/lib.rs | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/azure/src/lib.rs b/azure/src/lib.rs index 1b4fedf..ce1e570 100644 --- a/azure/src/lib.rs +++ b/azure/src/lib.rs @@ -35,7 +35,11 @@ use typespec_client_core::http::{BufResponse, HttpClient, Request}; use typespec_client_core::time::Duration; use wstd::http::{Body as WstdBody, Client}; -/// Set the wstd-based async runtime and HTTP client as the default for the Azure SDK. +/// Set the wstd-based async runtime as the default for the Azure SDK. +/// +/// This configures the global async runtime that the Azure SDK will use for +/// spawning tasks and sleeping. The HTTP client needs to be provided separately +/// when creating Azure SDK service clients using `http_client()`. /// /// This should be called once at the start of your application before using any /// Azure SDK functionality. @@ -52,7 +56,11 @@ use wstd::http::{Body as WstdBody, Client}; /// #[wstd::main] /// async fn main() -> Result<(), Box> { /// set_wstd_runtime()?; -/// // Use Azure SDK... +/// +/// // When creating Azure SDK clients, provide the HTTP client: +/// // let http_client = wstd_azure::http_client(); +/// // let client = SomeAzureClient::new(...).with_http_client(http_client); +/// /// Ok(()) /// } /// ``` @@ -121,7 +129,7 @@ impl HttpClient for WstdHttpClient { ) -> typespec_client_core::Result { // Convert the Azure SDK request to a wstd http request let url = request.url().to_string(); - let method = convert_method(request.method()); + let method = convert_method(request.method())?; let mut http_request = http::Request::builder().method(method).uri(&url); @@ -178,28 +186,40 @@ impl HttpClient for WstdHttpClient { } } -fn convert_method(method: typespec_client_core::http::Method) -> http::Method { +fn convert_method( + method: typespec_client_core::http::Method, +) -> typespec_client_core::Result { use typespec_client_core::http::Method; - match method { + Ok(match method { Method::Get => http::Method::GET, Method::Post => http::Method::POST, Method::Put => http::Method::PUT, Method::Delete => http::Method::DELETE, Method::Head => http::Method::HEAD, Method::Patch => http::Method::PATCH, - _ => http::Method::GET, // Default fallback for any future methods - } + _ => { + return Err(typespec_client_core::Error::with_message( + typespec_client_core::error::ErrorKind::Other, + format!("Unsupported HTTP method: {:?}", method), + )); + } + }) } fn convert_headers(headers: &http::HeaderMap) -> typespec_client_core::http::headers::Headers { let mut result = typespec_client_core::http::headers::Headers::new(); for (name, value) in headers.iter() { + // Only include headers with valid UTF-8 values + // Binary header values are rare in practice, and the Azure SDK + // primarily uses text-based headers if let Ok(value_str) = value.to_str() { result.insert( typespec_client_core::http::headers::HeaderName::from(name.to_string()), typespec_client_core::http::headers::HeaderValue::from(value_str.to_string()), ); } + // Note: Headers with non-UTF-8 values are silently skipped + // This is acceptable as such headers are uncommon in Azure SDK usage } result } From 75946a47ad57b8e539fcbb4e59f4fca94d16f277 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 2 Nov 2025 20:54:36 +0000 Subject: [PATCH 6/7] Update README with clarified usage instructions Co-authored-by: cataggar <87583576+cataggar@users.noreply.github.com> --- azure/README.md | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/azure/README.md b/azure/README.md index 1a424bd..f1ed7ef 100644 --- a/azure/README.md +++ b/azure/README.md @@ -18,19 +18,24 @@ make sure to set the `default-features = false` setting when depending on any ## Usage -To configure `wstd`'s wasi-http client and async runtime for the Azure Rust SDK, -call `wstd_azure::set_wstd_runtime()` once at the start of your application: +To configure `wstd`'s async runtime for the Azure Rust SDK, call +`wstd_azure::set_wstd_runtime()` once at the start of your application. +You'll also need to provide the HTTP client when creating Azure SDK service clients: ```rust -use wstd_azure::set_wstd_runtime; +use wstd_azure::{set_wstd_runtime, http_client}; #[wstd::main] async fn main() -> Result<(), Box> { - // Set up wstd runtime for Azure SDK + // Set up wstd async runtime for Azure SDK set_wstd_runtime()?; - // Now use Azure SDK as normal - // ... + // Get the HTTP client to use with Azure SDK clients + let client = http_client(); + + // Example: Create an Azure service client with the wstd HTTP client + // let blob_client = BlobServiceClient::new(...) + // .with_http_client(client); Ok(()) } From 1bacd67c747f9fccba49c550bd809b516f4ef5d6 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 3 Nov 2025 01:45:59 +0000 Subject: [PATCH 7/7] Update to use azure_storage_blob instead of azure_storage_blobs Co-authored-by: cataggar <87583576+cataggar@users.noreply.github.com> --- Cargo.toml | 2 +- azure/Cargo.toml | 2 +- azure/examples/blob_storage.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 81ce7e2..373a3db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -74,7 +74,7 @@ async-task = "4.7" async-trait = "0.1" axum = { version = "0.8.6", default-features = false } azure_core = { version = "0.29", default-features = false } -azure_storage_blobs = { version = "0.21", default-features = false } +azure_storage_blob = { version = "0.6", default-features = false } bytes = "1.10.1" cargo_metadata = "0.22" clap = { version = "4.5.26", features = ["derive"] } diff --git a/azure/Cargo.toml b/azure/Cargo.toml index c9a7e52..6d5d5a1 100644 --- a/azure/Cargo.toml +++ b/azure/Cargo.toml @@ -20,5 +20,5 @@ wstd.workspace = true [dev-dependencies] azure_core.workspace = true -azure_storage_blobs.workspace = true +azure_storage_blob.workspace = true clap.workspace = true diff --git a/azure/examples/blob_storage.rs b/azure/examples/blob_storage.rs index 7067853..0915daf 100644 --- a/azure/examples/blob_storage.rs +++ b/azure/examples/blob_storage.rs @@ -2,7 +2,7 @@ //! //! This example demonstrates how to set up the wstd runtime for use with the //! Azure Rust SDK. The actual Azure SDK client code will depend on which -//! version of the azure_storage_blobs crate you are using. +//! version of the azure_storage_blob crate you are using. //! //! This example *must be compiled in release mode* - in debug mode, the azure //! sdk's generated code will overflow the maximum permitted wasm locals in @@ -37,7 +37,7 @@ async fn main() -> Result<()> { println!("wstd runtime configured for Azure SDK"); println!(""); println!("To use the Azure SDK:"); - println!("1. Import the Azure SDK crates you need (e.g., azure_storage_blobs)"); + println!("1. Import the Azure SDK crates you need (e.g., azure_storage_blob)"); println!("2. Make sure to use default-features = false for Azure crates"); println!("3. Create your Azure SDK clients as normal"); println!("4. The SDK will use wstd's wasi-http implementation automatically");