From 7baa740cbf6d0a0882fe013926eedc9c19a611d6 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Tue, 13 Feb 2024 12:38:18 +0100 Subject: [PATCH 01/25] fix: add Origin Header in native app --- Cargo.lock | 102 ++++++++++++++++++++--------- ewebsock/Cargo.toml | 3 +- ewebsock/src/native_tungstenite.rs | 11 ++-- 3 files changed, 80 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7078229..40961a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -734,7 +734,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" name = "echo_server" version = "0.1.0" dependencies = [ - "tungstenite", + "tungstenite 0.20.1", ] [[package]] @@ -930,11 +930,12 @@ dependencies = [ "document-features", "futures", "futures-util", + "http 1.0.0", "js-sys", "log", "tokio", "tokio-tungstenite", - "tungstenite", + "tungstenite 0.21.0", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -1282,6 +1283,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "httparse" version = "1.8.0" @@ -2010,17 +2022,16 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "ring" -version = "0.16.20" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +checksum = "9babe80d5c16becf6594aa32ad2be8fe08498e7ae60b77de8df700e67f191d7e" dependencies = [ "cc", + "getrandom", "libc", - "once_cell", "spin", "untrusted", - "web-sys", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -2058,23 +2069,32 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" dependencies = [ "log", "ring", + "rustls-pki-types", "rustls-webpki", - "sct", + "subtle", + "zeroize", ] +[[package]] +name = "rustls-pki-types" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" + [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ "ring", + "rustls-pki-types", "untrusted", ] @@ -2099,16 +2119,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sctk-adwaita" version = "0.5.4" @@ -2264,9 +2274,9 @@ dependencies = [ [[package]] name = "spin" -version = "0.5.2" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] name = "static_assertions" @@ -2286,6 +2296,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "syn" version = "1.0.109" @@ -2427,7 +2443,7 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite", + "tungstenite 0.20.1", ] [[package]] @@ -2494,11 +2510,29 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.9", + "httparse", + "log", + "rand", + "sha1", + "thiserror", + "url", + "utf-8", +] + +[[package]] +name = "tungstenite" +version = "0.21.0" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.0.0", "httparse", "log", "rand", "rustls", + "rustls-pki-types", "sha1", "thiserror", "url", @@ -2545,9 +2579,9 @@ dependencies = [ [[package]] name = "untrusted" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" @@ -2780,11 +2814,11 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.24.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" dependencies = [ - "rustls-webpki", + "rustls-pki-types", ] [[package]] @@ -3160,6 +3194,12 @@ dependencies = [ "zvariant", ] +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + [[package]] name = "zvariant" version = "3.15.0" diff --git a/ewebsock/Cargo.toml b/ewebsock/Cargo.toml index 1723aec..477d22b 100644 --- a/ewebsock/Cargo.toml +++ b/ewebsock/Cargo.toml @@ -39,11 +39,12 @@ tokio = [ [dependencies] document-features = "0.2" +http = "1.0.0" log = "0.4" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tungstenite = { version = ">=0.17, <=0.20" } +tungstenite = { path = "../../tungstenite-rs" } # Optional dependencies for feature "tokio": async-stream = { version = "0.3", optional = true } diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index a03d105..31e1b95 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -1,8 +1,7 @@ #![allow(deprecated)] // TODO(emilk): Remove when we update tungstenite -use std::sync::mpsc::{Receiver, TryRecvError}; - use crate::{EventHandler, Result, WsEvent, WsMessage}; +use std::sync::mpsc::{Receiver, TryRecvError}; /// This is how you send [`WsMessage`]s to the server. /// @@ -68,7 +67,9 @@ pub(crate) fn ws_receive_impl(url: String, on_event: EventHandler) -> Result<()> /// # Errors /// * Any connection failures pub fn ws_receiver_blocking(url: &str, on_event: &EventHandler) -> Result<()> { - let (mut socket, response) = match tungstenite::connect(url) { + let uri: http::Uri = url.parse().unwrap(); + let builder = tungstenite::ClientRequestBuilder::new(uri).with_header("Origin", url); + let (mut socket, response) = match tungstenite::connect(builder) { Ok(result) => result, Err(err) => { return Err(format!("Connect: {err}")); @@ -143,7 +144,9 @@ pub fn ws_connect_blocking( on_event: &EventHandler, rx: &Receiver, ) -> Result<()> { - let (mut socket, response) = match tungstenite::connect(url) { + let uri: http::Uri = url.parse().unwrap(); + let builder = tungstenite::ClientRequestBuilder::new(uri).with_header("Origin", url); + let (mut socket, response) = match tungstenite::connect(builder) { Ok(result) => result, Err(err) => { return Err(format!("Connect: {err}")); From 39c1600ac0ce6aed10cae87d3f41a3b3897235ef Mon Sep 17 00:00:00 2001 From: n4n5 Date: Tue, 13 Feb 2024 12:41:39 +0100 Subject: [PATCH 02/25] correct cargo.toml --- Cargo.lock | 71 ++++++++++++++------------------------------- ewebsock/Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 40961a4..f7798fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -734,7 +734,7 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" name = "echo_server" version = "0.1.0" dependencies = [ - "tungstenite 0.20.1", + "tungstenite", ] [[package]] @@ -935,7 +935,7 @@ dependencies = [ "log", "tokio", "tokio-tungstenite", - "tungstenite 0.21.0", + "tungstenite", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -2069,32 +2069,23 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.2" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring", - "rustls-pki-types", "rustls-webpki", - "subtle", - "zeroize", + "sct", ] -[[package]] -name = "rustls-pki-types" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a716eb65e3158e90e17cd93d855216e27bde02745ab842f2cab4a39dba1bacf" - [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ "ring", - "rustls-pki-types", "untrusted", ] @@ -2119,6 +2110,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "sctk-adwaita" version = "0.5.4" @@ -2296,12 +2297,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - [[package]] name = "syn" version = "1.0.109" @@ -2443,7 +2438,7 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite 0.20.1", + "tungstenite", ] [[package]] @@ -2514,25 +2509,7 @@ dependencies = [ "httparse", "log", "rand", - "sha1", - "thiserror", - "url", - "utf-8", -] - -[[package]] -name = "tungstenite" -version = "0.21.0" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http 1.0.0", - "httparse", - "log", - "rand", "rustls", - "rustls-pki-types", "sha1", "thiserror", "url", @@ -2814,11 +2791,11 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "b291546d5d9d1eab74f069c77749f2cb8504a12caa20f0f2de93ddbf6f411888" dependencies = [ - "rustls-pki-types", + "rustls-webpki", ] [[package]] @@ -3194,12 +3171,6 @@ dependencies = [ "zvariant", ] -[[package]] -name = "zeroize" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" - [[package]] name = "zvariant" version = "3.15.0" diff --git a/ewebsock/Cargo.toml b/ewebsock/Cargo.toml index 477d22b..7d2996f 100644 --- a/ewebsock/Cargo.toml +++ b/ewebsock/Cargo.toml @@ -44,7 +44,7 @@ log = "0.4" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tungstenite = { path = "../../tungstenite-rs" } +tungstenite = { version = ">=0.17, <=0.21" } # Optional dependencies for feature "tokio": async-stream = { version = "0.3", optional = true } From 6629215560451b2796e6b3276166462c932d1177 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Mon, 13 May 2024 23:53:23 +0200 Subject: [PATCH 03/25] update --- ewebsock/Cargo.toml | 2 +- ewebsock/src/lib.rs | 30 +++++++++++++++++++++++++++++- ewebsock/src/native_tungstenite.rs | 20 +++++++++++--------- ewebsock/src/tungstenite_common.rs | 1 + 4 files changed, 42 insertions(+), 11 deletions(-) diff --git a/ewebsock/Cargo.toml b/ewebsock/Cargo.toml index 56b38f2..4ff6a6d 100644 --- a/ewebsock/Cargo.toml +++ b/ewebsock/Cargo.toml @@ -46,7 +46,7 @@ log = "0.4" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tungstenite = { version = ">=0.17, <=0.21" } +tungstenite = { version = "0.22" } # Optional dependencies for feature "tokio": async-stream = { version = "0.3", optional = true } diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 1e3c0a1..86aa366 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -43,6 +43,26 @@ mod web; #[cfg(target_arch = "wasm32")] pub use web::*; +/// transfrom uri and options into a request builder +pub fn into_requester( + uri: http::Uri, + options: Options, +) -> tungstenite::client::ClientRequestBuilder { + let mut client_request: tungstenite::ClientRequestBuilder = + tungstenite::client::ClientRequestBuilder::new(uri); + if let Some(headers) = options.additional_headers { + for (key, value) in headers { + client_request = client_request.with_header(key, value); + } + } + if let Some(subprotocols) = options.subprotocols { + for subprotocol in subprotocols { + client_request = client_request.with_sub_protocol(subprotocol); + } + } + client_request +} + // ---------------------------------------------------------------------------- /// A web-socket message. @@ -124,7 +144,7 @@ pub type Result = std::result::Result; pub(crate) type EventHandler = Box ControlFlow<()>>; /// Options for a connection. -#[derive(Clone, Copy, Debug, PartialEq, Eq)] +#[derive(Clone, Debug, PartialEq, Eq)] pub struct Options { /// The maximum size of a single incoming message frame, in bytes. /// @@ -133,12 +153,20 @@ pub struct Options { /// /// Ignored on Web. pub max_incoming_frame_size: usize, + + /// Additional [`Request`] headers + pub additional_headers: Option>, + + /// Additional subprotocols + pub subprotocols: Option>, } impl Default for Options { fn default() -> Self { Self { max_incoming_frame_size: 64 * 1024 * 1024, + additional_headers: None, + subprotocols: None, } } } diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index 5950cc4..e0775e7 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -167,17 +167,19 @@ pub fn ws_connect_blocking( on_event: &EventHandler, rx: &Receiver, ) -> Result<()> { - let config = tungstenite::protocol::WebSocketConfig::from(options); + let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default let uri: http::Uri = url.parse().unwrap(); - let builder = tungstenite::ClientRequestBuilder::new(uri).with_header("Origin", url); - let (mut socket, response) = - match tungstenite::client::connect_with_config(builder, Some(config), max_redirects) { - Ok(result) => result, - Err(err) => { - return Err(format!("Connect: {err}")); - } - }; + let (mut socket, response) = match tungstenite::client::connect_with_config( + crate::into_requester(uri, options), + Some(config), + max_redirects, + ) { + Ok(result) => result, + Err(err) => { + return Err(format!("Connect: {err}")); + } + }; log::debug!("WebSocket HTTP response code: {}", response.status()); log::trace!( diff --git a/ewebsock/src/tungstenite_common.rs b/ewebsock/src/tungstenite_common.rs index 465122a..996e00f 100644 --- a/ewebsock/src/tungstenite_common.rs +++ b/ewebsock/src/tungstenite_common.rs @@ -2,6 +2,7 @@ impl From for tungstenite::protocol::WebSocketConfig { fn from(options: crate::Options) -> Self { let crate::Options { max_incoming_frame_size, + .. } = options; tungstenite::protocol::WebSocketConfig { From f6d612ed24b036601b25d5a94477f2772edfc791 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Tue, 14 May 2024 00:28:07 +0200 Subject: [PATCH 04/25] add trunk --- README.md | 16 ++-- ewebsock/Cargo.toml | 2 +- ewebsock/src/lib.rs | 20 ----- ewebsock/src/native_tungstenite.rs | 40 +++++++--- example_app/.gitignore | 1 + example_app/Cargo.toml | 5 +- example_app/build_web.sh | 75 ------------------- example_app/index.html | 115 +++++++++++++++++++++++++++++ example_app/setup_web.sh | 12 --- example_app/src/main.rs | 24 +++++- example_app/start_server.sh | 7 +- 11 files changed, 186 insertions(+), 131 deletions(-) create mode 100644 example_app/.gitignore delete mode 100755 example_app/build_web.sh create mode 100644 example_app/index.html delete mode 100755 example_app/setup_web.sh diff --git a/README.md b/README.md index d71a418..bce232c 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,9 @@ This is a simple [WebSocket](https://en.wikipedia.org/wiki/WebSocket) library fo ## Usage ``` rust -let (mut sender, receiver) = ewebsock::connect("ws://example.com").unwrap(); +let options = ewebsock::Options::default(); +// add header and subprotocol to options +let (mut sender, receiver) = ewebsock::connect("ws://example.com", options).unwrap(); sender.send(ewebsock::WsMessage::Text("Hello!".into())); while let Some(event) = receiver.try_recv() { println!("Received {:?}", event); @@ -21,19 +23,19 @@ while let Some(event) = receiver.try_recv() { ``` ## Testing + First start the example echo server with: + ```sh cargo r -p echo_server ``` -Then test the native library with: +Then test the library with: ```sh +# native mode cargo run -p example_app -``` -And the web library with: -```sh -./example_app/start_server.sh & -./example_app/build_web.sh --open +# web mode +cd example_app/ && trunk serve ``` diff --git a/ewebsock/Cargo.toml b/ewebsock/Cargo.toml index 4ff6a6d..58da01b 100644 --- a/ewebsock/Cargo.toml +++ b/ewebsock/Cargo.toml @@ -46,7 +46,7 @@ log = "0.4" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tungstenite = { version = "0.22" } +tungstenite = { git = "https://github.com/snapview/tungstenite-rs" } # Optional dependencies for feature "tokio": async-stream = { version = "0.3", optional = true } diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 86aa366..d722864 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -43,26 +43,6 @@ mod web; #[cfg(target_arch = "wasm32")] pub use web::*; -/// transfrom uri and options into a request builder -pub fn into_requester( - uri: http::Uri, - options: Options, -) -> tungstenite::client::ClientRequestBuilder { - let mut client_request: tungstenite::ClientRequestBuilder = - tungstenite::client::ClientRequestBuilder::new(uri); - if let Some(headers) = options.additional_headers { - for (key, value) in headers { - client_request = client_request.with_header(key, value); - } - } - if let Some(subprotocols) = options.subprotocols { - for subprotocol in subprotocols { - client_request = client_request.with_sub_protocol(subprotocol); - } - } - client_request -} - // ---------------------------------------------------------------------------- /// A web-socket message. diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index e0775e7..ef70092 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -7,6 +7,26 @@ use std::{ use crate::{EventHandler, Options, Result, WsEvent, WsMessage}; +/// transfrom uri and options into a request builder +pub fn into_requester( + uri: http::Uri, + options: Options, +) -> tungstenite::client::ClientRequestBuilder { + let mut client_request: tungstenite::client::ClientRequestBuilder = + tungstenite::client::ClientRequestBuilder::new(uri); + if let Some(headers) = options.additional_headers { + for (key, value) in headers { + client_request = client_request.with_header(key, value); + } + } + if let Some(subprotocols) = options.subprotocols { + for subprotocol in subprotocols { + client_request = client_request.with_sub_protocol(subprotocol); + } + } + client_request +} + /// This is how you send [`WsMessage`]s to the server. /// /// When the last clone of this is dropped, the connection is closed. @@ -70,17 +90,19 @@ pub(crate) fn ws_receive_impl(url: String, options: Options, on_event: EventHand /// All errors are returned to the caller, and NOT reported via `on_event`. pub fn ws_receiver_blocking(url: &str, options: Options, on_event: &EventHandler) -> Result<()> { let uri: http::Uri = url.parse().unwrap(); - let builder = tungstenite::ClientRequestBuilder::new(uri).with_header("Origin", url); - let config = tungstenite::protocol::WebSocketConfig::from(options); + let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default - let (mut socket, response) = - match tungstenite::client::connect_with_config(builder, Some(config), max_redirects) { - Ok(result) => result, - Err(err) => { - return Err(format!("Connect: {err}")); - } - }; + let (mut socket, response) = match tungstenite::client::connect_with_config( + crate::into_requester(uri, options), + Some(config), + max_redirects, + ) { + Ok(result) => result, + Err(err) => { + return Err(format!("Connect: {err}")); + } + }; log::debug!("WebSocket HTTP response code: {}", response.status()); log::trace!( diff --git a/example_app/.gitignore b/example_app/.gitignore new file mode 100644 index 0000000..849ddff --- /dev/null +++ b/example_app/.gitignore @@ -0,0 +1 @@ +dist/ diff --git a/example_app/Cargo.toml b/example_app/Cargo.toml index a3c1aee..1312869 100644 --- a/example_app/Cargo.toml +++ b/example_app/Cargo.toml @@ -9,10 +9,6 @@ include = ["../LICENSE-APACHE", "../LICENSE-MIT", "**/*.rs", "Cargo.toml"] publish = false -[lib] -crate-type = ["cdylib", "rlib"] - - [features] default = [] @@ -25,6 +21,7 @@ ewebsock = { path = "../ewebsock", features = ["tls"] } eframe = "0.26.2" # Gives us egui, epi and web+native backends log = "0.4" +env_logger = "0.10" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/example_app/build_web.sh b/example_app/build_web.sh deleted file mode 100755 index 0d70672..0000000 --- a/example_app/build_web.sh +++ /dev/null @@ -1,75 +0,0 @@ -#!/bin/bash -set -eu -script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) -cd "$script_path/.." - -OPEN=false -FAST=false - -while test $# -gt 0; do - case "$1" in - -h|--help) - echo "build_web.sh [--fast] [--open]" - echo " --fast: skip optimization step" - echo " --open: open the result in a browser" - exit 0 - ;; - --fast) - shift - FAST=true - ;; - --open) - shift - OPEN=true - ;; - *) - break - ;; - esac -done - -# ./setup_web.sh # <- call this first! - -CRATE_NAME="example_app" -CRATE_NAME_SNAKE_CASE="${CRATE_NAME//-/_}" # for those who name crates with-kebab-case - -# This is required to enable the web_sys clipboard API which egui_web uses -# https://rustwasm.github.io/wasm-bindgen/api/web_sys/struct.Clipboard.html -# https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html -export RUSTFLAGS=--cfg=web_sys_unstable_apis - -# Clear output from old stuff: -rm -f docs/${CRATE_NAME_SNAKE_CASE}_bg.wasm - -echo "Building rust…" -BUILD=release -cargo build -p ${CRATE_NAME} --release --lib --target wasm32-unknown-unknown - -# Get the output directory (in the workspace it is in another location) -TARGET=`cargo metadata --format-version=1 | jq --raw-output .target_directory` - -echo "Generating JS bindings for wasm…" -TARGET_NAME="${CRATE_NAME_SNAKE_CASE}.wasm" -wasm-bindgen "${TARGET}/wasm32-unknown-unknown/${BUILD}/${TARGET_NAME}" \ - --out-dir docs --no-modules --no-typescript - -if [ "${FAST}" = false ]; then - echo "Optimizing wasm…" - # to get wasm-opt: apt/brew/dnf install binaryen - wasm-opt docs/${CRATE_NAME}_bg.wasm -O2 --fast-math -o docs/${CRATE_NAME}_bg.wasm # add -g to get debug symbols -fi - -echo "Finished: docs/${CRATE_NAME_SNAKE_CASE}.wasm" - -if [ "${OPEN}" = true ]; then - if [[ "$OSTYPE" == "linux-gnu"* ]]; then - # Linux, ex: Fedora - xdg-open http://localhost:8081/index.html - elif [[ "$OSTYPE" == "msys" ]]; then - # Windows - start http://localhost:8081/index.html - else - # Darwin/MacOS, or something else - open http://localhost:8081/index.html - fi -fi diff --git a/example_app/index.html b/example_app/index.html new file mode 100644 index 0000000..798ed5f --- /dev/null +++ b/example_app/index.html @@ -0,0 +1,115 @@ + + + + + + + + + + ewebsock demo + + + + + + + + + + + + + + + + + + + + + diff --git a/example_app/setup_web.sh b/example_app/setup_web.sh deleted file mode 100755 index 8430339..0000000 --- a/example_app/setup_web.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash -set -eu -script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) -cd "$script_path/.." - -# Pre-requisites: -rustup target add wasm32-unknown-unknown -cargo install wasm-bindgen-cli -cargo update -p wasm-bindgen - -# For local tests with `./start_server`: -cargo install basic-http-server diff --git a/example_app/src/main.rs b/example_app/src/main.rs index df4ee6f..8bf6bc6 100644 --- a/example_app/src/main.rs +++ b/example_app/src/main.rs @@ -12,7 +12,8 @@ async fn main() -> eframe::Result<()> { fn main() -> eframe::Result<()> { main_impl() } - +// When compiling natively: +#[cfg(not(target_arch = "wasm32"))] fn main_impl() -> Result<(), eframe::Error> { env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). @@ -24,3 +25,24 @@ fn main_impl() -> Result<(), eframe::Error> { Box::new(|_cc| Box::new(app)), ) } + +// When compiling to web using trunk: +#[cfg(target_arch = "wasm32")] +fn main_impl() -> Result<(), eframe::Error> { + // Redirect `log` message to `console.log` and friends: + eframe::WebLogger::init(log::LevelFilter::Debug).ok(); + + let web_options = eframe::WebOptions::default(); + + wasm_bindgen_futures::spawn_local(async { + eframe::WebRunner::new() + .start( + "the_canvas_id", // hardcode it + web_options, + Box::new(|_cc| Box::new(example_app::ExampleApp::default())), + ) + .await + .expect("failed to start eframe"); + }); + Ok(()) +} diff --git a/example_app/start_server.sh b/example_app/start_server.sh index 4f44c90..3fb0a0c 100755 --- a/example_app/start_server.sh +++ b/example_app/start_server.sh @@ -1,6 +1,9 @@ #!/bin/bash set -eu -script_path=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P ) +script_path=$( + cd "$(dirname "${BASH_SOURCE[0]}")" + pwd -P +) cd "$script_path/.." # Starts a local web-server that serves the contents of the `doc/` folder, @@ -10,5 +13,5 @@ cargo install basic-http-server echo "open http://localhost:8081" -(cd docs && basic-http-server --addr 127.0.0.1:8081 .) +(cd docs && basic-http-server --addr 127.0.0.1:8090 .) # (cd docs && python3 -m http.server 8081 --bind 127.0.0.1) From e79b007ece152d85be2608138d03117825c36a1c Mon Sep 17 00:00:00 2001 From: n4n5 Date: Tue, 14 May 2024 00:29:11 +0200 Subject: [PATCH 05/25] rm manifest --- example_app/index.html | 1 - 1 file changed, 1 deletion(-) diff --git a/example_app/index.html b/example_app/index.html index 798ed5f..8c5d4c5 100644 --- a/example_app/index.html +++ b/example_app/index.html @@ -14,7 +14,6 @@ - From bf3e0708e94498f43bfea323c4b526c62ad6916b Mon Sep 17 00:00:00 2001 From: n4n5 Date: Tue, 14 May 2024 00:38:27 +0200 Subject: [PATCH 06/25] rm --- example_app/start_server.sh | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100755 example_app/start_server.sh diff --git a/example_app/start_server.sh b/example_app/start_server.sh deleted file mode 100755 index 3fb0a0c..0000000 --- a/example_app/start_server.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -eu -script_path=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - pwd -P -) -cd "$script_path/.." - -# Starts a local web-server that serves the contents of the `doc/` folder, -# which is the folder to where the web version is compiled. - -cargo install basic-http-server - -echo "open http://localhost:8081" - -(cd docs && basic-http-server --addr 127.0.0.1:8090 .) -# (cd docs && python3 -m http.server 8081 --bind 127.0.0.1) From 164d67da8104e863fdd10997db502de0b228c33d Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sun, 2 Jun 2024 11:20:17 +0200 Subject: [PATCH 07/25] bump version and clippy --- Cargo.lock | 7 ++++--- ewebsock/Cargo.toml | 4 ++-- ewebsock/src/native_tungstenite.rs | 13 +++++++++---- 3 files changed, 15 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df95daa..f01f1b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3092,9 +3092,9 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83b561d025642014097b66e6c1bb422783339e0909e4429cde4749d1990bc38" +checksum = "d46baf930138837d65e25e3b33be49c9228579a6135dbf756b5cb9e4283e7cef" dependencies = [ "futures-util", "log", @@ -3189,7 +3189,8 @@ dependencies = [ [[package]] name = "tungstenite" version = "0.22.0" -source = "git+https://github.com/snapview/tungstenite-rs#ec0e3b98030346a8bea02517e2b32a13ccc427bb" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc55edf6afe467bfa92835ae73628d8a934818aa1591c6ebacc4379b7c0ad09" dependencies = [ "byteorder", "bytes", diff --git a/ewebsock/Cargo.toml b/ewebsock/Cargo.toml index 6d9443f..df33086 100644 --- a/ewebsock/Cargo.toml +++ b/ewebsock/Cargo.toml @@ -48,7 +48,7 @@ log = "0.4" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tungstenite = { git = "https://github.com/snapview/tungstenite-rs" } +tungstenite = { version = "0.22" } # Optional dependencies for feature "tokio": async-stream = { version = "0.3", optional = true } @@ -58,7 +58,7 @@ futures-util = { version = "0.3", optional = true, default-features = false, fea "std", ] } tokio = { version = "1.16", features = ["rt", "sync"], optional = true } -tokio-tungstenite = { version = ">=0.17, <=0.21", optional = true } +tokio-tungstenite = { version = "0.22", optional = true } # web: [target.'cfg(target_arch = "wasm32")'.dependencies] diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index ef70092..092448e 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -12,8 +12,7 @@ pub fn into_requester( uri: http::Uri, options: Options, ) -> tungstenite::client::ClientRequestBuilder { - let mut client_request: tungstenite::client::ClientRequestBuilder = - tungstenite::client::ClientRequestBuilder::new(uri); + let mut client_request = tungstenite::client::ClientRequestBuilder::new(uri); if let Some(headers) = options.additional_headers { for (key, value) in headers { client_request = client_request.with_header(key, value); @@ -89,7 +88,10 @@ pub(crate) fn ws_receive_impl(url: String, options: Options, on_event: EventHand /// # Errors /// All errors are returned to the caller, and NOT reported via `on_event`. pub fn ws_receiver_blocking(url: &str, options: Options, on_event: &EventHandler) -> Result<()> { - let uri: http::Uri = url.parse().unwrap(); + let uri: http::Uri = match url.parse() { + Ok(uri) => uri, + Err(err) => return Err(format!("Failed to parse URI: {err}")), + }; let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default @@ -191,7 +193,10 @@ pub fn ws_connect_blocking( ) -> Result<()> { let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default - let uri: http::Uri = url.parse().unwrap(); + let uri: http::Uri = match url.parse() { + Ok(uri) => uri, + Err(err) => return Err(format!("Failed to parse URI: {err}")), + }; let (mut socket, response) = match tungstenite::client::connect_with_config( crate::into_requester(uri, options), Some(config), From 68c2b0ad1d6506c2461d2f241634538ddb193be3 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sun, 2 Jun 2024 11:59:26 +0200 Subject: [PATCH 08/25] bump echo_server and TODO --- Cargo.lock | 2 +- echo_server/Cargo.toml | 2 +- echo_server/src/main.rs | 15 ++++++++------- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f01f1b3..77efc4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1019,7 +1019,7 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" name = "echo_server" version = "0.1.0" dependencies = [ - "tungstenite 0.21.0", + "tungstenite 0.22.0", ] [[package]] diff --git a/echo_server/Cargo.toml b/echo_server/Cargo.toml index 6e905f3..ea8a645 100644 --- a/echo_server/Cargo.toml +++ b/echo_server/Cargo.toml @@ -10,4 +10,4 @@ publish = false [dependencies] -tungstenite = { version = ">=0.17, <=0.21" } +tungstenite = { version = "0.22" } diff --git a/echo_server/src/main.rs b/echo_server/src/main.rs index d7cb412..c02998c 100644 --- a/echo_server/src/main.rs +++ b/echo_server/src/main.rs @@ -1,4 +1,3 @@ -#![allow(deprecated)] // TODO(emilk): Remove when we update tungstenite #![allow(clippy::unwrap_used, clippy::disallowed_methods)] // We are just testing here. use std::{net::TcpListener, thread::spawn}; @@ -11,14 +10,16 @@ fn main() { spawn(move || { let mut websocket = tungstenite::accept(stream.unwrap()).unwrap(); eprintln!("New client connected"); - while let Ok(msg) = websocket.read_message() { + loop { + let msg = websocket.read().unwrap(); + // We do not want to send back ping/pong messages. if msg.is_binary() || msg.is_text() { - if websocket.write_message(msg).is_ok() { - eprintln!("Responded."); - } else { - break; - } + websocket.send(msg).unwrap(); + eprintln!("Responded."); + } else { + eprintln!("Message recevied not text or binary, leaving."); + break; } } eprintln!("Client left."); From aa122dbedb887ea66ffe625399175fc6f95c1510 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sun, 2 Jun 2024 12:04:10 +0200 Subject: [PATCH 09/25] todo done --- ewebsock/src/lib.rs | 4 ++++ ewebsock/src/native_tungstenite.rs | 15 +++++++-------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 72a00c4..a596b41 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -139,6 +139,9 @@ pub struct Options { /// Additional subprotocols pub subprotocols: Option>, + + /// Delay + pub delay_blocking: Option, } impl Default for Options { @@ -147,6 +150,7 @@ impl Default for Options { max_incoming_frame_size: 64 * 1024 * 1024, additional_headers: None, subprotocols: None, + delay_blocking: None, } } } diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index 092448e..50b4205 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -1,5 +1,3 @@ -#![allow(deprecated)] // TODO(emilk): Remove when we update tungstenite - use std::{ ops::ControlFlow, sync::mpsc::{Receiver, TryRecvError}, @@ -121,7 +119,7 @@ pub fn ws_receiver_blocking(url: &str, options: Options, on_event: &EventHandler } loop { - let control = match socket.read_message() { + let control = match socket.read() { Ok(incoming_msg) => match incoming_msg { tungstenite::protocol::Message::Text(text) => { on_event(WsEvent::Message(WsMessage::Text(text))) @@ -191,6 +189,7 @@ pub fn ws_connect_blocking( on_event: &EventHandler, rx: &Receiver, ) -> Result<()> { + let delay = options.delay_blocking.unwrap_or(10); let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default let uri: http::Uri = match url.parse() { @@ -249,22 +248,22 @@ pub fn ws_connect_blocking( WsMessage::Pong(data) => tungstenite::protocol::Message::Pong(data), WsMessage::Unknown(_) => panic!("You cannot send WsMessage::Unknown"), }; - if let Err(err) = socket.write_message(outgoing_message) { + if let Err(err) = socket.send(outgoing_message) { socket.close(None).ok(); - socket.write_pending().ok(); + socket.flush().ok(); return Err(format!("send: {err}")); } } Err(TryRecvError::Disconnected) => { log::debug!("WsSender dropped - closing connection."); socket.close(None).ok(); - socket.write_pending().ok(); + socket.flush().ok(); return Ok(()); } Err(TryRecvError::Empty) => {} }; - let control = match socket.read_message() { + let control = match socket.read() { Ok(incoming_msg) => { did_work = true; match incoming_msg { @@ -306,7 +305,7 @@ pub fn ws_connect_blocking( } if !did_work { - std::thread::sleep(std::time::Duration::from_millis(10)); // TODO(emilk): make configurable + std::thread::sleep(std::time::Duration::from_millis(delay)); } } } From a1c33bb71cb6fed98da09d352f89d9482f1858d7 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sun, 2 Jun 2024 12:06:19 +0200 Subject: [PATCH 10/25] correct if --- echo_server/src/main.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/echo_server/src/main.rs b/echo_server/src/main.rs index c02998c..94eb65b 100644 --- a/echo_server/src/main.rs +++ b/echo_server/src/main.rs @@ -15,11 +15,14 @@ fn main() { // We do not want to send back ping/pong messages. if msg.is_binary() || msg.is_text() { - websocket.send(msg).unwrap(); - eprintln!("Responded."); + if let Err(err) = websocket.send(msg) { + eprintln!("Error sending message: {err}"); + break; + } else { + eprintln!("Responded."); + } } else { - eprintln!("Message recevied not text or binary, leaving."); - break; + eprintln!("Message recevied not text or binary."); } } eprintln!("Client left."); From 1f1fe1489703bb80a7c43c03efd46c0b94b006f1 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sun, 2 Jun 2024 12:07:52 +0200 Subject: [PATCH 11/25] docs --- ewebsock/src/lib.rs | 4 ++-- ewebsock/src/native_tungstenite.rs | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index a596b41..7370e3d 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -140,8 +140,8 @@ pub struct Options { /// Additional subprotocols pub subprotocols: Option>, - /// Delay - pub delay_blocking: Option, + /// Delay blocking in ms - default 10ms + pub delay_blocking: Option, } impl Default for Options { diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index 50b4205..9bf1c6a 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -189,7 +189,9 @@ pub fn ws_connect_blocking( on_event: &EventHandler, rx: &Receiver, ) -> Result<()> { - let delay = options.delay_blocking.unwrap_or(10); + let delay = options + .delay_blocking + .unwrap_or(std::time::Duration::from_millis(10)); // default value 10ms let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default let uri: http::Uri = match url.parse() { @@ -305,7 +307,7 @@ pub fn ws_connect_blocking( } if !did_work { - std::thread::sleep(std::time::Duration::from_millis(delay)); + std::thread::sleep(delay); } } } From 2154c8170025f96a986f66e172ec2914b517871d Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sun, 2 Jun 2024 13:46:12 +0200 Subject: [PATCH 12/25] bump to 0.23 ! --- Cargo.lock | 210 ++--------------------------------------- echo_server/Cargo.toml | 2 +- ewebsock/Cargo.toml | 4 +- 3 files changed, 10 insertions(+), 206 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 77efc4b..5cab41a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -468,33 +468,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" -[[package]] -name = "aws-lc-rs" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8487b59d62764df8231cb371c459314df895b41756df457a1fb1243d65c89195" -dependencies = [ - "aws-lc-sys", - "mirai-annotations", - "paste", - "zeroize", -] - -[[package]] -name = "aws-lc-sys" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c15eb61145320320eb919d9bab524617a7aa4216c78d342fae3a758bc33073e4" -dependencies = [ - "bindgen", - "cc", - "cmake", - "dunce", - "fs_extra", - "libc", - "paste", -] - [[package]] name = "backtrace" version = "0.3.71" @@ -510,29 +483,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "bindgen" -version = "0.69.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" -dependencies = [ - "bitflags 2.5.0", - "cexpr", - "clang-sys", - "itertools", - "lazy_static", - "lazycell", - "log", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.63", - "which", -] - [[package]] name = "bit-set" version = "0.5.3" @@ -717,15 +667,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -747,17 +688,6 @@ dependencies = [ "libc", ] -[[package]] -name = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading 0.8.3", -] - [[package]] name = "clipboard-win" version = "5.3.1" @@ -767,15 +697,6 @@ dependencies = [ "error-code", ] -[[package]] -name = "cmake" -version = "0.1.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" -dependencies = [ - "cc", -] - [[package]] name = "cocoa" version = "0.25.0" @@ -1009,17 +930,11 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" -[[package]] -name = "dunce" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" - [[package]] name = "echo_server" version = "0.1.0" dependencies = [ - "tungstenite 0.22.0", + "tungstenite", ] [[package]] @@ -1129,12 +1044,6 @@ dependencies = [ "winit", ] -[[package]] -name = "either" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" - [[package]] name = "emath" version = "0.26.2" @@ -1288,7 +1197,7 @@ dependencies = [ "log", "tokio", "tokio-tungstenite", - "tungstenite 0.22.0", + "tungstenite", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -1382,12 +1291,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs_extra" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" - [[package]] name = "futures" version = "0.3.30" @@ -1553,12 +1456,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - [[package]] name = "glow" version = "0.13.1" @@ -1838,15 +1735,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.11" @@ -1910,18 +1798,6 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.154" @@ -2050,12 +1926,6 @@ dependencies = [ "paste", ] -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.2" @@ -2077,12 +1947,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "mirai-annotations" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" - [[package]] name = "naga" version = "0.19.2" @@ -2152,16 +2016,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -2487,16 +2341,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" -[[package]] -name = "prettyplease" -version = "0.2.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" -dependencies = [ - "proc-macro2", - "syn 2.0.63", -] - [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2713,8 +2557,6 @@ version = "0.23.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afabcee0551bd1aa3e18e5adbf2c0544722014b899adb31bd186ec638d3da97e" dependencies = [ - "aws-lc-rs", - "log", "once_cell", "rustls-pki-types", "rustls-webpki", @@ -2734,7 +2576,6 @@ version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ - "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -2816,12 +2657,6 @@ dependencies = [ "digest", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3092,14 +2927,14 @@ dependencies = [ [[package]] name = "tokio-tungstenite" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d46baf930138837d65e25e3b33be49c9228579a6135dbf756b5cb9e4283e7cef" +checksum = "becd34a233e7e31a3dbf7c7241b38320f57393dcae8e7324b0167d21b8e320b0" dependencies = [ "futures-util", "log", "tokio", - "tungstenite 0.21.0", + "tungstenite", ] [[package]] @@ -3169,28 +3004,9 @@ checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" [[package]] name = "tungstenite" -version = "0.21.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "rand", - "sha1", - "thiserror", - "url", - "utf-8", -] - -[[package]] -name = "tungstenite" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc55edf6afe467bfa92835ae73628d8a934818aa1591c6ebacc4379b7c0ad09" +checksum = "6e2e2ce1e47ed2994fd43b04c8f618008d4cabdd5ee34027cf14f9d918edd9c8" dependencies = [ "byteorder", "bytes", @@ -3646,18 +3462,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix 0.38.34", -] - [[package]] name = "widestring" version = "1.1.0" diff --git a/echo_server/Cargo.toml b/echo_server/Cargo.toml index ea8a645..b0242b4 100644 --- a/echo_server/Cargo.toml +++ b/echo_server/Cargo.toml @@ -10,4 +10,4 @@ publish = false [dependencies] -tungstenite = { version = "0.22" } +tungstenite = { version = "0.23" } diff --git a/ewebsock/Cargo.toml b/ewebsock/Cargo.toml index df33086..5a791bc 100644 --- a/ewebsock/Cargo.toml +++ b/ewebsock/Cargo.toml @@ -48,7 +48,7 @@ log = "0.4" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -tungstenite = { version = "0.22" } +tungstenite = { version = "0.23" } # Optional dependencies for feature "tokio": async-stream = { version = "0.3", optional = true } @@ -58,7 +58,7 @@ futures-util = { version = "0.3", optional = true, default-features = false, fea "std", ] } tokio = { version = "1.16", features = ["rt", "sync"], optional = true } -tokio-tungstenite = { version = "0.22", optional = true } +tokio-tungstenite = { version = "0.23", optional = true } # web: [target.'cfg(target_arch = "wasm32")'.dependencies] From 66a3534ce32fe4474d5dc91de2a4c8a7ecc9f9cd Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sun, 2 Jun 2024 13:53:01 +0200 Subject: [PATCH 13/25] docs --- ewebsock/src/lib.rs | 2 +- ewebsock/src/native_tungstenite.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 7370e3d..703722b 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -134,7 +134,7 @@ pub struct Options { /// Ignored on Web. pub max_incoming_frame_size: usize, - /// Additional [`Request`] headers + /// Additional Request headers pub additional_headers: Option>, /// Additional subprotocols diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index 9bf1c6a..f704956 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -81,7 +81,7 @@ pub(crate) fn ws_receive_impl(url: String, options: Options, on_event: EventHand /// Connect and call the given event handler on each received event. /// -/// Blocking version of [`ws_receive`], only available on native. +/// Blocking version of [`crate::ws_receive`], only available on native. /// /// # Errors /// All errors are returned to the caller, and NOT reported via `on_event`. @@ -179,7 +179,7 @@ pub(crate) fn ws_connect_impl( /// Connect and call the given event handler on each received event. /// -/// This is a blocking variant of [`ws_connect`], only available on native. +/// This is a blocking variant of [`crate::ws_connect`], only available on native. /// /// # Errors /// All errors are returned to the caller, and NOT reported via `on_event`. From f8abaa797741fdd7a9dff2f1d30793bf1eeb9f5f Mon Sep 17 00:00:00 2001 From: n4n5 <56606507+Its-Just-Nans@users.noreply.github.com> Date: Sun, 2 Jun 2024 15:42:17 +0200 Subject: [PATCH 14/25] Update main.rs --- echo_server/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/echo_server/src/main.rs b/echo_server/src/main.rs index 94eb65b..0fafe42 100644 --- a/echo_server/src/main.rs +++ b/echo_server/src/main.rs @@ -22,7 +22,7 @@ fn main() { eprintln!("Responded."); } } else { - eprintln!("Message recevied not text or binary."); + eprintln!("Message received not text or binary."); } } eprintln!("Client left."); From 34fba9d1aa35416e69d5af232b4d1c42c1a7cea3 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Sun, 2 Jun 2024 15:46:11 +0200 Subject: [PATCH 15/25] remove useless --- Cargo.lock | 1 - ewebsock/Cargo.toml | 1 - ewebsock/src/native_tungstenite.rs | 6 +++--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5cab41a..a8e758d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1192,7 +1192,6 @@ dependencies = [ "document-features", "futures", "futures-util", - "http", "js-sys", "log", "tokio", diff --git a/ewebsock/Cargo.toml b/ewebsock/Cargo.toml index 5a791bc..11f7208 100644 --- a/ewebsock/Cargo.toml +++ b/ewebsock/Cargo.toml @@ -43,7 +43,6 @@ tokio = [ [dependencies] document-features = "0.2" -http = "1.0.0" log = "0.4" # native: diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index f704956..bdc57fd 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -7,7 +7,7 @@ use crate::{EventHandler, Options, Result, WsEvent, WsMessage}; /// transfrom uri and options into a request builder pub fn into_requester( - uri: http::Uri, + uri: tungstenite::http::Uri, options: Options, ) -> tungstenite::client::ClientRequestBuilder { let mut client_request = tungstenite::client::ClientRequestBuilder::new(uri); @@ -86,7 +86,7 @@ pub(crate) fn ws_receive_impl(url: String, options: Options, on_event: EventHand /// # Errors /// All errors are returned to the caller, and NOT reported via `on_event`. pub fn ws_receiver_blocking(url: &str, options: Options, on_event: &EventHandler) -> Result<()> { - let uri: http::Uri = match url.parse() { + let uri: tungstenite::http::Uri = match url.parse() { Ok(uri) => uri, Err(err) => return Err(format!("Failed to parse URI: {err}")), }; @@ -194,7 +194,7 @@ pub fn ws_connect_blocking( .unwrap_or(std::time::Duration::from_millis(10)); // default value 10ms let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default - let uri: http::Uri = match url.parse() { + let uri: tungstenite::http::Uri = match url.parse() { Ok(uri) => uri, Err(err) => return Err(format!("Failed to parse URI: {err}")), }; From d1545f3fb6e88a42bb85d459265e99b7510ea846 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Mon, 3 Jun 2024 17:54:58 +0200 Subject: [PATCH 16/25] typos --- ewebsock/src/native_tungstenite.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index bdc57fd..8ae169e 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -5,7 +5,7 @@ use std::{ use crate::{EventHandler, Options, Result, WsEvent, WsMessage}; -/// transfrom uri and options into a request builder +/// transform uri and options into a request builder pub fn into_requester( uri: tungstenite::http::Uri, options: Options, From d1d5c0948021902550b1a37ad5918e076d501bcb Mon Sep 17 00:00:00 2001 From: n4n5 Date: Wed, 5 Jun 2024 14:20:29 +0200 Subject: [PATCH 17/25] solve problems --- README.md | 2 +- echo_server/src/main.rs | 4 +--- ewebsock/src/lib.rs | 16 +++++++++------- ewebsock/src/native_tungstenite.rs | 30 +++++++++++------------------- 4 files changed, 22 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index bce232c..78133ab 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ This is a simple [WebSocket](https://en.wikipedia.org/wiki/WebSocket) library fo ``` rust let options = ewebsock::Options::default(); -// add header and subprotocol to options +// see documentation for more options let (mut sender, receiver) = ewebsock::connect("ws://example.com", options).unwrap(); sender.send(ewebsock::WsMessage::Text("Hello!".into())); while let Some(event) = receiver.try_recv() { diff --git a/echo_server/src/main.rs b/echo_server/src/main.rs index 0fafe42..cf082df 100644 --- a/echo_server/src/main.rs +++ b/echo_server/src/main.rs @@ -10,9 +10,7 @@ fn main() { spawn(move || { let mut websocket = tungstenite::accept(stream.unwrap()).unwrap(); eprintln!("New client connected"); - loop { - let msg = websocket.read().unwrap(); - + while let Ok(msg) = websocket.read() { // We do not want to send back ping/pong messages. if msg.is_binary() || msg.is_text() { if let Err(err) = websocket.send(msg) { diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 703722b..57bd2f0 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -135,22 +135,24 @@ pub struct Options { pub max_incoming_frame_size: usize, /// Additional Request headers - pub additional_headers: Option>, + pub additional_headers: Vec<(String, String)>, - /// Additional subprotocols - pub subprotocols: Option>, + /// Additional subprotocols - + /// https://www.iana.org/assignments/websocket/websocket.xml + /// https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#miscellaneous + pub subprotocols: Vec, /// Delay blocking in ms - default 10ms - pub delay_blocking: Option, + pub delay_blocking: std::time::Duration, } impl Default for Options { fn default() -> Self { Self { max_incoming_frame_size: 64 * 1024 * 1024, - additional_headers: None, - subprotocols: None, - delay_blocking: None, + additional_headers: vec![], + subprotocols: vec![], + delay_blocking: std::time::Duration::from_millis(10), // default value 10ms, } } } diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index 8ae169e..693a031 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -11,15 +11,11 @@ pub fn into_requester( options: Options, ) -> tungstenite::client::ClientRequestBuilder { let mut client_request = tungstenite::client::ClientRequestBuilder::new(uri); - if let Some(headers) = options.additional_headers { - for (key, value) in headers { - client_request = client_request.with_header(key, value); - } + for (key, value) in options.additional_headers { + client_request = client_request.with_header(key, value); } - if let Some(subprotocols) = options.subprotocols { - for subprotocol in subprotocols { - client_request = client_request.with_sub_protocol(subprotocol); - } + for subprotocol in options.subprotocols { + client_request = client_request.with_sub_protocol(subprotocol); } client_request } @@ -86,10 +82,9 @@ pub(crate) fn ws_receive_impl(url: String, options: Options, on_event: EventHand /// # Errors /// All errors are returned to the caller, and NOT reported via `on_event`. pub fn ws_receiver_blocking(url: &str, options: Options, on_event: &EventHandler) -> Result<()> { - let uri: tungstenite::http::Uri = match url.parse() { - Ok(uri) => uri, - Err(err) => return Err(format!("Failed to parse URI: {err}")), - }; + let uri: tungstenite::http::Uri = url + .parse() + .map_err(|err| format!("Failed to parse URI: {err}"))?; let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default @@ -189,15 +184,12 @@ pub fn ws_connect_blocking( on_event: &EventHandler, rx: &Receiver, ) -> Result<()> { - let delay = options - .delay_blocking - .unwrap_or(std::time::Duration::from_millis(10)); // default value 10ms + let delay = options.delay_blocking; let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default - let uri: tungstenite::http::Uri = match url.parse() { - Ok(uri) => uri, - Err(err) => return Err(format!("Failed to parse URI: {err}")), - }; + let uri: tungstenite::http::Uri = url + .parse() + .map_err(|err| format!("Failed to parse URI: {err}"))?; let (mut socket, response) = match tungstenite::client::connect_with_config( crate::into_requester(uri, options), Some(config), From 0ac302f7e6bfff4e5eb840c4897230c9571f3350 Mon Sep 17 00:00:00 2001 From: n4n5 Date: Thu, 6 Jun 2024 19:10:07 +0200 Subject: [PATCH 18/25] add for native tokio --- ewebsock/src/lib.rs | 15 +++++++++++++ ewebsock/src/native_tungstenite.rs | 23 +++++++------------- ewebsock/src/native_tungstenite_tokio.rs | 27 +++++++++++++++++++++--- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 57bd2f0..65ae985 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -230,3 +230,18 @@ pub fn ws_connect(url: String, options: Options, on_event: EventHandler) -> Resu pub fn ws_receive(url: String, options: Options, on_event: EventHandler) -> Result<()> { ws_receive_impl(url, options, on_event) } + +/// transform uri and options into a request builder +pub fn into_requester( + uri: tungstenite::http::Uri, + options: Options, +) -> tungstenite::client::ClientRequestBuilder { + let mut client_request = tungstenite::client::ClientRequestBuilder::new(uri); + for (key, value) in options.additional_headers { + client_request = client_request.with_header(key, value); + } + for subprotocol in options.subprotocols { + client_request = client_request.with_sub_protocol(subprotocol); + } + client_request +} diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index 63547c8..43ad056 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -7,21 +7,6 @@ use std::{ use crate::{EventHandler, Options, Result, WsEvent, WsMessage}; -/// transform uri and options into a request builder -pub fn into_requester( - uri: tungstenite::http::Uri, - options: Options, -) -> tungstenite::client::ClientRequestBuilder { - let mut client_request = tungstenite::client::ClientRequestBuilder::new(uri); - for (key, value) in options.additional_headers { - client_request = client_request.with_header(key, value); - } - for subprotocol in options.subprotocols { - client_request = client_request.with_sub_protocol(subprotocol); - } - client_request -} - /// This is how you send [`WsMessage`]s to the server. /// /// When the last clone of this is dropped, the connection is closed. @@ -305,3 +290,11 @@ pub fn ws_connect_blocking( } } } + +#[test] +fn test_connect() { + let options = crate::Options::default(); + // see documentation for more options + let (mut sender, _receiver) = crate::connect("ws://example.com", options).unwrap(); + sender.send(crate::WsMessage::Text("Hello!".into())); +} diff --git a/ewebsock/src/native_tungstenite_tokio.rs b/ewebsock/src/native_tungstenite_tokio.rs index d2a941f..b51382d 100644 --- a/ewebsock/src/native_tungstenite_tokio.rs +++ b/ewebsock/src/native_tungstenite_tokio.rs @@ -49,11 +49,17 @@ async fn ws_connect_async( on_event: EventHandler, ) { use futures::StreamExt as _; - - let config = tungstenite::protocol::WebSocketConfig::from(options); + let uri: tungstenite::http::Uri = match url.parse() { + Ok(uri) => uri, + Err(err) => { + on_event(WsEvent::Error(err.to_string())); + return; + } + }; + let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let disable_nagle = false; // God damn everyone who adds negations to the names of their variables let (ws_stream, _response) = match tokio_tungstenite::connect_async_with_config( - url, + crate::into_requester(uri, options), Some(config), disable_nagle, ) @@ -146,3 +152,18 @@ fn ws_connect_native(url: String, options: Options, on_event: EventHandler) -> W pub(crate) fn ws_receive_impl(url: String, options: Options, on_event: EventHandler) -> Result<()> { ws_connect_impl(url, options, on_event).map(|sender| sender.forget()) } + +#[cfg(feature = "tokio")] +#[test] +fn test_connect_tokio() { + tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .unwrap() + .block_on(async { + let options = crate::Options::default(); + // see documentation for more options + let (mut sender, _receiver) = crate::connect("ws://example.com", options).unwrap(); + sender.send(crate::WsMessage::Text("Hello!".into())); + }); +} From 4443a0631de183ab0e69d1a9fe65eab33388d4ec Mon Sep 17 00:00:00 2001 From: n4n5 Date: Thu, 6 Jun 2024 19:15:54 +0200 Subject: [PATCH 19/25] clean --- ewebsock/src/lib.rs | 15 --------------- ewebsock/src/native_tungstenite.rs | 5 +++-- ewebsock/src/native_tungstenite_tokio.rs | 4 ++-- ewebsock/src/tungstenite_common.rs | 15 +++++++++++++++ 4 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 65ae985..57bd2f0 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -230,18 +230,3 @@ pub fn ws_connect(url: String, options: Options, on_event: EventHandler) -> Resu pub fn ws_receive(url: String, options: Options, on_event: EventHandler) -> Result<()> { ws_receive_impl(url, options, on_event) } - -/// transform uri and options into a request builder -pub fn into_requester( - uri: tungstenite::http::Uri, - options: Options, -) -> tungstenite::client::ClientRequestBuilder { - let mut client_request = tungstenite::client::ClientRequestBuilder::new(uri); - for (key, value) in options.additional_headers { - client_request = client_request.with_header(key, value); - } - for subprotocol in options.subprotocols { - client_request = client_request.with_sub_protocol(subprotocol); - } - client_request -} diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index 43ad056..e4f6f2b 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -5,6 +5,7 @@ use std::{ sync::mpsc::{Receiver, TryRecvError}, }; +use crate::tungstenite_common::into_requester; use crate::{EventHandler, Options, Result, WsEvent, WsMessage}; /// This is how you send [`WsMessage`]s to the server. @@ -76,7 +77,7 @@ pub fn ws_receiver_blocking(url: &str, options: Options, on_event: &EventHandler let max_redirects = 3; // tungstenite default let (mut socket, response) = match tungstenite::client::connect_with_config( - crate::into_requester(uri, options), + into_requester(uri, options), Some(config), max_redirects, ) { @@ -178,7 +179,7 @@ pub fn ws_connect_blocking( .parse() .map_err(|err| format!("Failed to parse URI: {err}"))?; let (mut socket, response) = match tungstenite::client::connect_with_config( - crate::into_requester(uri, options), + into_requester(uri, options), Some(config), max_redirects, ) { diff --git a/ewebsock/src/native_tungstenite_tokio.rs b/ewebsock/src/native_tungstenite_tokio.rs index b51382d..fda9189 100644 --- a/ewebsock/src/native_tungstenite_tokio.rs +++ b/ewebsock/src/native_tungstenite_tokio.rs @@ -1,5 +1,6 @@ use std::ops::ControlFlow; +use crate::tungstenite_common::into_requester; use crate::{EventHandler, Options, Result, WsEvent, WsMessage}; /// This is how you send [`WsMessage`]s to the server. @@ -59,7 +60,7 @@ async fn ws_connect_async( let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let disable_nagle = false; // God damn everyone who adds negations to the names of their variables let (ws_stream, _response) = match tokio_tungstenite::connect_async_with_config( - crate::into_requester(uri, options), + into_requester(uri, options), Some(config), disable_nagle, ) @@ -122,7 +123,6 @@ async fn ws_connect_async( futures_util::future::select(reader, writer).await; } -#[allow(clippy::unnecessary_wraps)] pub(crate) fn ws_connect_impl( url: String, options: Options, diff --git a/ewebsock/src/tungstenite_common.rs b/ewebsock/src/tungstenite_common.rs index 4b8cfdc..c42f7d7 100644 --- a/ewebsock/src/tungstenite_common.rs +++ b/ewebsock/src/tungstenite_common.rs @@ -15,3 +15,18 @@ impl From for tungstenite::protocol::WebSocketConfig { } } } + +/// transform uri and options into a request builder +pub fn into_requester( + uri: tungstenite::http::Uri, + options: crate::Options, +) -> tungstenite::client::ClientRequestBuilder { + let mut client_request = tungstenite::client::ClientRequestBuilder::new(uri); + for (key, value) in options.additional_headers { + client_request = client_request.with_header(key, value); + } + for subprotocol in options.subprotocols { + client_request = client_request.with_sub_protocol(subprotocol); + } + client_request +} From c70c985b275f717b30ba625b0927e6e5bc263a1a Mon Sep 17 00:00:00 2001 From: n4n5 Date: Thu, 6 Jun 2024 19:18:54 +0200 Subject: [PATCH 20/25] add links --- ewebsock/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 57bd2f0..9ff78f4 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -138,8 +138,8 @@ pub struct Options { pub additional_headers: Vec<(String, String)>, /// Additional subprotocols - - /// https://www.iana.org/assignments/websocket/websocket.xml - /// https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers#miscellaneous + /// + /// pub subprotocols: Vec, /// Delay blocking in ms - default 10ms From baa5bbb6b911ccc4ed9e97a3eccdae7ac53aeb9a Mon Sep 17 00:00:00 2001 From: n4n5 Date: Thu, 6 Jun 2024 19:23:35 +0200 Subject: [PATCH 21/25] add back --- ewebsock/src/native_tungstenite_tokio.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/ewebsock/src/native_tungstenite_tokio.rs b/ewebsock/src/native_tungstenite_tokio.rs index fda9189..458a9fa 100644 --- a/ewebsock/src/native_tungstenite_tokio.rs +++ b/ewebsock/src/native_tungstenite_tokio.rs @@ -123,6 +123,7 @@ async fn ws_connect_async( futures_util::future::select(reader, writer).await; } +#[allow(clippy::unnecessary_wraps)] pub(crate) fn ws_connect_impl( url: String, options: Options, From b58c796938fb61196c6d91d71c93e1c74f0c6196 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 14:01:56 +0200 Subject: [PATCH 22/25] Revert Cargo.lock --- Cargo.lock | 941 ++++++++++++++++++++++++----------------------------- 1 file changed, 433 insertions(+), 508 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c9e9e23..dc25bb8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph" -version = "0.2.26" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e53b0a3d5760cd2ba9b787ae0c6440ad18ee294ff71b05e3381c900a7d16cfd" +checksum = "80179d7dd5d7e8c285d67c4a1e652972a92de7475beddfb92028c76463b13225" dependencies = [ "ab_glyph_rasterizer", "owned_ttf_parser", @@ -20,9 +20,9 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "accesskit" -version = "0.12.3" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a4b14f3d99c1255dcba8f45621ab1a2e7540a0009652d33989005a4d0bfc6b" +checksum = "6cb10ed32c63247e4e39a8f42e8e30fb9442fbf7878c8e4a9849e7e381619bea" [[package]] name = "accesskit_consumer" @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.22.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -106,9 +106,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "42cd52102d3df161c77a887b608d7a4897d7cc112886a9537b738a887a03aaff" dependencies = [ "cfg-if", "getrandom", @@ -119,18 +119,18 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.3" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-activity" @@ -139,7 +139,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" dependencies = [ "android-properties", - "bitflags 2.5.0", + "bitflags 2.4.2", "cc", "cesu8", "jni", @@ -170,16 +170,17 @@ dependencies = [ [[package]] name = "arboard" -version = "3.4.0" +version = "3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" +checksum = "1faa3c733d9a3dd6fbaf85da5d162a2e03b2e0033a90dceb0e2a90fdd1e5380a" dependencies = [ "clipboard-win", "log", - "objc2 0.5.2", - "objc2-app-kit", - "objc2-foundation", + "objc", + "objc-foundation", + "objc_id", "parking_lot", + "thiserror", "x11rb", ] @@ -222,26 +223,28 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.3.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" +checksum = "f28243a43d821d11341ab73c80bed182dc015c514b951616cf79bd4af39af0c3" dependencies = [ "concurrent-queue", - "event-listener-strategy", + "event-listener 5.0.0", + "event-listener-strategy 0.5.0", "futures-core", "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.12.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8828ec6e544c02b0d6691d21ed9f9218d0384a82542855073c2a3f58304aaf0" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ + "async-lock 3.3.0", "async-task", "concurrent-queue", - "fastrand 2.1.0", - "futures-lite 2.3.0", + "fastrand 2.0.1", + "futures-lite 2.2.0", "slab", ] @@ -279,18 +282,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.3" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" dependencies = [ - "async-lock 3.4.0", + "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.2.0", "parking", - "polling 3.7.1", - "rustix 0.38.34", + "polling 3.4.0", + "rustix 0.38.31", "slab", "tracing", "windows-sys 0.52.0", @@ -307,12 +310,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.4.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 5.3.1", - "event-listener-strategy", + "event-listener 4.0.3", + "event-listener-strategy 0.4.0", "pin-project-lite", ] @@ -335,37 +338,37 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.34", + "rustix 0.38.31", "windows-sys 0.48.0", ] [[package]] name = "async-recursion" -version = "1.1.1" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "async-signal" -version = "0.2.7" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329972aa325176e89114919f2a80fdae4f4c040f66a370b1a1159c6c0f94e7aa" +checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.3.3", - "async-lock 3.4.0", + "async-io 2.3.1", + "async-lock 2.8.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.34", + "rustix 0.38.31", "signal-hook-registry", "slab", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -387,24 +390,24 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "async-task" -version = "4.7.1" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -463,15 +466,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.3.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.72" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -505,9 +508,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block" @@ -539,7 +542,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" dependencies = [ - "objc-sys 0.3.5", + "objc-sys 0.3.2", ] [[package]] @@ -562,52 +565,46 @@ dependencies = [ "objc2 0.4.1", ] -[[package]] -name = "block2" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" -dependencies = [ - "objc2 0.5.2", -] - [[package]] name = "blocking" -version = "1.6.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ "async-channel", + "async-lock 3.3.0", "async-task", + "fastrand 2.0.1", "futures-io", - "futures-lite 2.3.0", + "futures-lite 2.2.0", "piper", + "tracing", ] [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" dependencies = [ "bytemuck_derive", ] [[package]] name = "bytemuck_derive" -version = "1.7.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee891b04274a59bd38b412188e24b849617b2e45a0fd8d057deb63e7403761b" +checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -618,9 +615,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "calloop" @@ -628,10 +625,10 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "log", - "polling 3.7.1", - "rustix 0.38.34", + "polling 3.4.0", + "rustix 0.38.31", "slab", "thiserror", ] @@ -643,20 +640,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" dependencies = [ "calloop", - "rustix 0.38.34", + "rustix 0.38.31", "wayland-backend", "wayland-client", ] [[package]] name = "cc" -version = "1.0.98" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", - "once_cell", ] [[package]] @@ -688,9 +684,9 @@ dependencies = [ [[package]] name = "clipboard-win" -version = "5.3.1" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79f4473f5144e20d9aceaf2972478f06ddf687831eafeeb434fbaf0acc4144ad" +checksum = "3ec832972fefb8cf9313b45a0d1945e29c9c251f1d4c6eafc5fe2124c02d2e81" dependencies = [ "error-code", ] @@ -774,9 +770,9 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.7" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" dependencies = [ "bytes", "memchr", @@ -784,9 +780,9 @@ dependencies = [ [[package]] name = "concurrent-queue" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ "crossbeam-utils", ] @@ -809,9 +805,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" -version = "0.23.2" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c07782be35f9e1140080c6b96f0d44b739e2278479f64e02fdab4e32dfd8b081" +checksum = "970a29baf4110c26fedbc7f82107d42c23f7e88e404c4577ed73fe99ff85a212" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -842,18 +838,18 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -873,9 +869,9 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "derivative" @@ -910,7 +906,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.3", + "libloading 0.8.1", ] [[package]] @@ -924,9 +920,9 @@ dependencies = [ [[package]] name = "downcast-rs" -version = "1.2.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "echo_server" @@ -967,7 +963,7 @@ dependencies = [ "parking_lot", "percent-encoding", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.2", + "raw-window-handle 0.6.0", "static_assertions", "thiserror", "wasm-bindgen", @@ -1019,7 +1015,7 @@ dependencies = [ "arboard", "egui", "log", - "raw-window-handle 0.6.2", + "raw-window-handle 0.6.0", "smithay-clipboard", "web-time", "webbrowser", @@ -1036,7 +1032,7 @@ dependencies = [ "egui", "glow", "log", - "memoffset 0.9.1", + "memoffset 0.9.0", "wasm-bindgen", "web-sys", "winit", @@ -1069,7 +1065,7 @@ checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1109,9 +1105,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.9" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1119,9 +1115,9 @@ dependencies = [ [[package]] name = "error-code" -version = "3.2.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0474425d51df81997e2f90a21591180b38eccf27292d755f3e30750225c175b" +checksum = "281e452d3bad4005426416cdba5ccfd4f5c1280e10099e21db27f7c1c28347fc" [[package]] name = "event-listener" @@ -1142,9 +1138,20 @@ dependencies = [ [[package]] name = "event-listener" -version = "5.3.1" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" +dependencies = [ + "concurrent-queue", + "parking", + "pin-project-lite", +] + +[[package]] +name = "event-listener" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "b72557800024fabbaa2449dd4bf24e37b93702d457a4d4f2b0dd1f0f039f20c1" dependencies = [ "concurrent-queue", "parking", @@ -1153,11 +1160,21 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" +dependencies = [ + "event-listener 4.0.3", + "pin-project-lite", +] + +[[package]] +name = "event-listener-strategy" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" +checksum = "feedafcaa9b749175d5ac357452a9d41ea2911da598fde46ce1fe02c37751291" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.0.0", "pin-project-lite", ] @@ -1202,9 +1219,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fdeflate" @@ -1217,9 +1234,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1249,7 +1266,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1332,11 +1349,11 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ - "fastrand 2.1.0", + "fastrand 2.0.1", "futures-core", "futures-io", "parking", @@ -1351,7 +1368,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -1406,9 +1423,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -1417,9 +1434,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gl_generator" @@ -1450,7 +1467,7 @@ version = "0.31.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18fcd4ae4e86d991ad1300b8f57166e5be0c95ef1f63f3f5b827f8a164548746" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "cfg_aliases", "cgl", "core-foundation", @@ -1459,7 +1476,7 @@ dependencies = [ "glutin_glx_sys", "glutin_wgl_sys", "icrate", - "libloading 0.8.3", + "libloading 0.8.1", "objc2 0.4.1", "once_cell", "raw-window-handle 0.5.2", @@ -1515,7 +1532,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "gpu-alloc-types", ] @@ -1525,7 +1542,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", ] [[package]] @@ -1547,7 +1564,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "gpu-descriptor-types", "hashbrown", ] @@ -1558,14 +1575,14 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", ] [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", "allocator-api2", @@ -1577,10 +1594,10 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "com", "libc", - "libloading 0.8.3", + "libloading 0.8.1", "thiserror", "widestring", "winapi", @@ -1588,9 +1605,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hex" @@ -1615,9 +1632,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" dependencies = [ "bytes", "fnv", @@ -1659,9 +1676,9 @@ dependencies = [ [[package]] name = "image" -version = "0.24.9" +version = "0.24.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5690139d2f55868e080017335e4b94cb7414274c74f1669c84fb5feba2c9f69d" +checksum = "034bbe799d1909622a74d1193aa50147769440040ff36cb2baa947609b0a4e23" dependencies = [ "bytemuck", "byteorder", @@ -1672,9 +1689,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown", @@ -1682,9 +1699,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.13" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if", ] @@ -1713,9 +1730,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jni" @@ -1741,18 +1758,18 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -1764,7 +1781,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.3", + "libloading 0.8.1", "pkg-config", ] @@ -1776,9 +1793,9 @@ checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" @@ -1792,12 +1809,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-sys 0.48.0", ] [[package]] @@ -1806,7 +1823,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "libc", "redox_syscall 0.4.1", ] @@ -1819,9 +1836,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "litrs" @@ -1831,9 +1848,9 @@ checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1841,9 +1858,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "malloc_buf" @@ -1856,9 +1873,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" @@ -1880,9 +1897,9 @@ dependencies = [ [[package]] name = "memoffset" -version = "0.9.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", ] @@ -1893,7 +1910,7 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "block", "core-graphics-types", "foreign-types", @@ -1904,9 +1921,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", "simd-adler32", @@ -1925,12 +1942,12 @@ dependencies = [ [[package]] name = "naga" -version = "0.19.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" +checksum = "8878eb410fc90853da3908aebfe61d73d26d4437ef850b70050461f939509899" dependencies = [ "bit-set", - "bitflags 2.5.0", + "bitflags 2.4.2", "codespan-reporting", "hexf-parse", "indexmap", @@ -1949,13 +1966,13 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "jni-sys", "log", "ndk-sys", "num_enum", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.2", + "raw-window-handle 0.6.0", "thiserror", ] @@ -1994,9 +2011,9 @@ checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" [[package]] name = "num-traits" -version = "0.2.19" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -2029,7 +2046,7 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2042,6 +2059,17 @@ dependencies = [ "objc_exception", ] +[[package]] +name = "objc-foundation" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" +dependencies = [ + "block", + "objc", + "objc_id", +] + [[package]] name = "objc-sys" version = "0.2.0-beta.2" @@ -2050,9 +2078,9 @@ checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" [[package]] name = "objc-sys" -version = "0.3.5" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" +checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459" [[package]] name = "objc2" @@ -2071,60 +2099,10 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" dependencies = [ - "objc-sys 0.3.5", + "objc-sys 0.3.2", "objc2-encode 3.0.0", ] -[[package]] -name = "objc2" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" -dependencies = [ - "objc-sys 0.3.5", - "objc2-encode 4.0.3", -] - -[[package]] -name = "objc2-app-kit" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "libc", - "objc2 0.5.2", - "objc2-core-data", - "objc2-core-image", - "objc2-foundation", - "objc2-quartz-core", -] - -[[package]] -name = "objc2-core-data" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", -] - -[[package]] -name = "objc2-core-image" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" -dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", - "objc2-metal", -] - [[package]] name = "objc2-encode" version = "2.0.0-pre.2" @@ -2141,62 +2119,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" [[package]] -name = "objc2-encode" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" - -[[package]] -name = "objc2-foundation" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "libc", - "objc2 0.5.2", -] - -[[package]] -name = "objc2-metal" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" -dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", -] - -[[package]] -name = "objc2-quartz-core" -version = "0.2.2" +name = "objc_exception" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" dependencies = [ - "bitflags 2.5.0", - "block2 0.5.1", - "objc2 0.5.2", - "objc2-foundation", - "objc2-metal", + "cc", ] [[package]] -name = "objc_exception" -version = "0.1.2" +name = "objc_id" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" dependencies = [ - "cc", + "objc", ] [[package]] name = "object" -version = "0.35.0" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -2228,9 +2172,9 @@ dependencies = [ [[package]] name = "owned_ttf_parser" -version = "0.21.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b41438d2fc63c46c74a2203bf5ccd82c41ba04347b2fcf5754f230b167067d5" +checksum = "d4586edfe4c648c71797a74c84bacb32b52b212eff5dfe2bb9f2c599844023e7" dependencies = [ "ttf-parser", ] @@ -2243,9 +2187,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.3" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -2253,22 +2197,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.10" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.4.1", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.48.5", ] [[package]] name = "paste" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" @@ -2278,9 +2222,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2290,12 +2234,12 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.3" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" +checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" dependencies = [ "atomic-waker", - "fastrand 2.1.0", + "fastrand 2.0.1", "futures-io", ] @@ -2307,9 +2251,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "png" -version = "0.17.13" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06e4b0d3d1312775e782c86c91a111aa1f910cbb65e1337f9975b5f9a554b5e1" +checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -2336,15 +2280,14 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.1" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6a007746f34ed64099e88783b0ae369eaa3da6392868ba262e2af9b8fbaea1" +checksum = "30054e72317ab98eddd8561db0f6524df3367636884b7b21b703e4b280a84a14" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi", "pin-project-lite", - "rustix 0.38.34", + "rustix 0.38.31", "tracing", "windows-sys 0.52.0", ] @@ -2382,18 +2325,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] name = "profiling" -version = "1.0.15" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" +checksum = "0f0f7f43585c34e4fdd7497d746bc32e14458cf11c69341cc0587b1d825dde42" [[package]] name = "quick-xml" @@ -2406,9 +2349,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2451,9 +2394,9 @@ checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" [[package]] name = "raw-window-handle" -version = "0.6.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" +checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" [[package]] name = "redox_syscall" @@ -2473,20 +2416,11 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" -dependencies = [ - "bitflags 2.5.0", -] - [[package]] name = "regex" -version = "1.10.4" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -2496,9 +2430,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -2507,36 +2441,35 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "renderdoc-sys" -version = "1.1.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" +checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" [[package]] name = "ring" -version = "0.17.8" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", - "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -2560,22 +2493,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.14", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.23.9" +version = "0.23.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a218f0f6d05669de4eabfb24f31ce802035c952429d037507b4a4a39f0e60c5b" +checksum = "ebbbdb961df0ad3f2652da8f3fdc4b36122f568f968f45ad3316f26c025c677b" dependencies = [ "once_cell", "rustls-pki-types", @@ -2586,15 +2519,15 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7" [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" dependencies = [ "ring", "rustls-pki-types", @@ -2637,33 +2570,33 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "serde_repr" -version = "0.1.19" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2679,9 +2612,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" dependencies = [ "libc", ] @@ -2712,9 +2645,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smithay-client-toolkit" @@ -2722,14 +2655,14 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "calloop", "calloop-wayland-source", "cursor-icon", "libc", "log", "memmap2", - "rustix 0.38.34", + "rustix 0.38.31", "thiserror", "wayland-backend", "wayland-client", @@ -2743,9 +2676,9 @@ dependencies = [ [[package]] name = "smithay-clipboard" -version = "0.7.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c091e7354ea8059d6ad99eace06dd13ddeedbb0ac72d40a9a6e7ff790525882d" +checksum = "0bb62b280ce5a5cba847669933a0948d00904cf83845c944eae96a4738cea1a6" dependencies = [ "libc", "smithay-client-toolkit", @@ -2754,9 +2687,9 @@ dependencies = [ [[package]] name = "smol_str" -version = "0.2.2" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd538fb6910ac1099850255cf94a94df6551fbdd602454387d0adb2d1ca6dead" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" dependencies = [ "serde", ] @@ -2773,12 +2706,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.48.0", ] [[package]] @@ -2793,7 +2726,7 @@ version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", ] [[package]] @@ -2827,9 +2760,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.66" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -2838,13 +2771,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.10.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", - "fastrand 2.1.0", - "rustix 0.38.34", + "fastrand 2.0.1", + "rustix 0.38.31", "windows-sys 0.52.0", ] @@ -2859,22 +2792,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2919,9 +2852,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -2929,20 +2862,20 @@ dependencies = [ "mio", "num_cpus", "pin-project-lite", - "socket2 0.5.7", + "socket2 0.5.5", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -2959,9 +2892,9 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" @@ -3004,7 +2937,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] @@ -3018,9 +2951,9 @@ dependencies = [ [[package]] name = "ttf-parser" -version = "0.21.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" +checksum = "17f77d76d837a7830fe1d4f12b7b4ba4192c1888001c7164257e4bc6d21d96b4" [[package]] name = "tungstenite" @@ -3064,7 +2997,7 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ - "memoffset 0.9.1", + "memoffset 0.9.0", "tempfile", "winapi", ] @@ -3083,9 +3016,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] @@ -3098,9 +3031,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -3139,15 +3072,15 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "waker-fn" -version = "1.2.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" +checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" [[package]] name = "walkdir" -version = "2.5.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -3180,15 +3113,15 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -3214,7 +3147,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -3227,13 +3160,13 @@ checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wayland-backend" -version = "0.3.4" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34e9e6b6d4a2bb4e7e69433e0b35c7923b95d4dc8503a84d25ec917a4bbfdf07" +checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" dependencies = [ "cc", "downcast-rs", - "rustix 0.38.34", + "rustix 0.38.31", "scoped-tls", "smallvec", "wayland-sys", @@ -3241,12 +3174,12 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.3" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e63801c85358a431f986cffa74ba9599ff571fc5774ac113ed3b490c19a1133" +checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" dependencies = [ - "bitflags 2.5.0", - "rustix 0.38.34", + "bitflags 2.4.2", + "rustix 0.38.31", "wayland-backend", "wayland-scanner", ] @@ -3257,18 +3190,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "cursor-icon", "wayland-backend", ] [[package]] name = "wayland-cursor" -version = "0.31.3" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a206e8b2b53b1d3fcb9428fec72bc278ce539e2fa81fe2bfc1ab27703d5187b9" +checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" dependencies = [ - "rustix 0.38.34", + "rustix 0.38.31", "wayland-client", "xcursor", ] @@ -3279,7 +3212,7 @@ version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "wayland-backend", "wayland-client", "wayland-scanner", @@ -3291,7 +3224,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "wayland-backend", "wayland-client", "wayland-protocols", @@ -3304,7 +3237,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "wayland-backend", "wayland-client", "wayland-protocols", @@ -3313,9 +3246,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.2" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67da50b9f80159dec0ea4c11c13e24ef9e7574bd6ce24b01860a175010cea565" +checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" dependencies = [ "proc-macro2", "quick-xml", @@ -3324,9 +3257,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.31.2" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "105b1842da6554f91526c14a2a2172897b7f745a805d62af4ce698706be79c12" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" dependencies = [ "dlib", "log", @@ -3336,9 +3269,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -3356,9 +3289,9 @@ dependencies = [ [[package]] name = "webbrowser" -version = "0.8.15" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db67ae75a9405634f5882791678772c94ff5f16a66535aae186e26aa0841fc8b" +checksum = "82b2391658b02c27719fc5a0a73d6e696285138e8b12fba9d4baa70451023c71" dependencies = [ "core-foundation", "home", @@ -3373,18 +3306,18 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.2" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" dependencies = [ "rustls-pki-types", ] [[package]] name = "wgpu" -version = "0.19.4" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbd7311dbd2abcfebaabf1841a2824ed7c8be443a0f29166e5d3c6a53a762c01" +checksum = "0bfe9a310dcf2e6b85f00c46059aaeaf4184caa8e29a1ecd4b7a704c3482332d" dependencies = [ "arrayvec", "cfg-if", @@ -3393,7 +3326,7 @@ dependencies = [ "log", "parking_lot", "profiling", - "raw-window-handle 0.6.2", + "raw-window-handle 0.6.0", "smallvec", "static_assertions", "wasm-bindgen", @@ -3406,13 +3339,13 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.19.4" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b94525fc99ba9e5c9a9e24764f2bc29bad0911a7446c12f446a8277369bf3a" +checksum = "6b15e451d4060ada0d99a64df44e4d590213496da7c4f245572d51071e8e30ed" dependencies = [ "arrayvec", "bit-vec", - "bitflags 2.5.0", + "bitflags 2.4.2", "cfg_aliases", "codespan-reporting", "indexmap", @@ -3421,7 +3354,7 @@ dependencies = [ "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.6.2", + "raw-window-handle 0.6.0", "rustc-hash", "smallvec", "thiserror", @@ -3432,14 +3365,14 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.19.4" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc1a4924366df7ab41a5d8546d6534f1f33231aa5b3f72b9930e300f254e39c3" +checksum = "e3bb47856236bfafc0bc591a925eb036ac19cd987624a447ff353e7a7e7e6f72" dependencies = [ "android_system_properties", "arrayvec", "ash", - "bitflags 2.5.0", + "bitflags 2.4.2", "cfg_aliases", "core-graphics-types", "glow", @@ -3451,16 +3384,15 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.3", + "libloading 0.8.1", "log", "metal", "naga", - "ndk-sys", "objc", "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.6.2", + "raw-window-handle 0.6.0", "renderdoc-sys", "rustc-hash", "smallvec", @@ -3473,20 +3405,20 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.19.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b671ff9fb03f78b46ff176494ee1ebe7d603393f42664be55b64dc8d53969805" +checksum = "895fcbeb772bfb049eb80b2d6e47f6c9af235284e9703c96fc0218a42ffd5af2" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "js-sys", "web-sys", ] [[package]] name = "widestring" -version = "1.1.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -3506,11 +3438,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ - "windows-sys 0.52.0", + "winapi", ] [[package]] @@ -3537,7 +3469,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.5", + "windows-targets 0.52.0", ] [[package]] @@ -3546,7 +3478,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.0", ] [[package]] @@ -3595,7 +3527,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.0", ] [[package]] @@ -3630,18 +3562,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", - "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] @@ -3658,9 +3589,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -3676,9 +3607,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -3694,15 +3625,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" - -[[package]] -name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -3718,9 +3643,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -3736,9 +3661,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -3754,9 +3679,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -3772,20 +3697,20 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winit" -version = "0.29.15" +version = "0.29.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" +checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" dependencies = [ "ahash", "android-activity", "atomic-waker", - "bitflags 2.5.0", + "bitflags 2.4.2", "bytemuck", "calloop", "cfg_aliases", @@ -3804,9 +3729,9 @@ dependencies = [ "orbclient", "percent-encoding", "raw-window-handle 0.5.2", - "raw-window-handle 0.6.2", + "raw-window-handle 0.6.0", "redox_syscall 0.3.5", - "rustix 0.38.34", + "rustix 0.38.31", "sctk-adwaita", "smithay-client-toolkit", "smol_str", @@ -3847,24 +3772,24 @@ dependencies = [ [[package]] name = "x11rb" -version = "0.13.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d91ffca73ee7f68ce055750bf9f6eca0780b8c85eff9bc046a3b0da41755e12" +checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.3", + "libloading 0.8.1", "once_cell", - "rustix 0.38.34", + "rustix 0.38.31", "x11rb-protocol", ] [[package]] name = "x11rb-protocol" -version = "0.13.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" +checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" [[package]] name = "xcursor" @@ -3888,7 +3813,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d039de8032a9a8856a6be89cea3e5d12fdd82306ab7c94d74e6deab2460651c5" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.4.2", "dlib", "log", "once_cell", @@ -3903,15 +3828,15 @@ checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" [[package]] name = "xml-rs" -version = "0.8.20" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" +checksum = "0fcb9cbac069e033553e8bb871be2fbdffcab578eb25bd0f7c508cedc6dcd75a" [[package]] name = "zbus" -version = "3.15.2" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675d170b632a6ad49804c8cf2105d7c31eddd3312555cffd4b740e08e97c25e6" +checksum = "c45d06ae3b0f9ba1fb2671268b975557d8f5a84bb5ec6e43964f87e763d8bca8" dependencies = [ "async-broadcast", "async-executor", @@ -3950,9 +3875,9 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "3.15.2" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7131497b0f887e8061b430c530240063d33bf9455fa34438f388a245da69e0a5" +checksum = "b4a1ba45ed0ad344b85a2bb5a1fe9830aed23d67812ea39a586e7d0136439c7d" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", @@ -3964,9 +3889,9 @@ dependencies = [ [[package]] name = "zbus_names" -version = "2.6.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437d738d3750bed6ca9b8d423ccc7a8eb284f6b1d6d4e225a0e4e6258d864c8d" +checksum = "fb80bb776dbda6e23d705cf0123c3b95df99c4ebeaec6c2599d4a5419902b4a9" dependencies = [ "serde", "static_assertions", @@ -3975,35 +3900,35 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.66", + "syn 2.0.48", ] [[package]] name = "zeroize" -version = "1.8.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" [[package]] name = "zvariant" -version = "3.15.2" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eef2be88ba09b358d3b58aca6e41cd853631d44787f319a1383ca83424fb2db" +checksum = "44b291bee0d960c53170780af148dca5fa260a63cdd24f1962fa82e03e53338c" dependencies = [ "byteorder", "enumflags2", @@ -4015,9 +3940,9 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "3.15.2" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37c24dc0bed72f5f90d1f8bb5b07228cbf63b3c6e9f82d82559d4bae666e7ed9" +checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ "proc-macro-crate 1.3.1", "proc-macro2", From 4eb7f00a7d9e40f86431a84c87431061396daf9d Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 14:04:14 +0200 Subject: [PATCH 23/25] Write which URL was bad in error message --- ewebsock/src/native_tungstenite.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ewebsock/src/native_tungstenite.rs b/ewebsock/src/native_tungstenite.rs index e4f6f2b..f7f11c7 100644 --- a/ewebsock/src/native_tungstenite.rs +++ b/ewebsock/src/native_tungstenite.rs @@ -72,7 +72,7 @@ pub(crate) fn ws_receive_impl(url: String, options: Options, on_event: EventHand pub fn ws_receiver_blocking(url: &str, options: Options, on_event: &EventHandler) -> Result<()> { let uri: tungstenite::http::Uri = url .parse() - .map_err(|err| format!("Failed to parse URI: {err}"))?; + .map_err(|err| format!("Failed to parse URL {url:?}: {err}"))?; let config = tungstenite::protocol::WebSocketConfig::from(options.clone()); let max_redirects = 3; // tungstenite default @@ -177,7 +177,7 @@ pub fn ws_connect_blocking( let max_redirects = 3; // tungstenite default let uri: tungstenite::http::Uri = url .parse() - .map_err(|err| format!("Failed to parse URI: {err}"))?; + .map_err(|err| format!("Failed to parse URL {url:?}: {err}"))?; let (mut socket, response) = match tungstenite::client::connect_with_config( into_requester(uri, options), Some(config), From bf272234303cd33229581bf7bb51a3162bade3ad Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 14:05:58 +0200 Subject: [PATCH 24/25] Better URL parse error message --- ewebsock/src/native_tungstenite_tokio.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ewebsock/src/native_tungstenite_tokio.rs b/ewebsock/src/native_tungstenite_tokio.rs index 458a9fa..69f6f09 100644 --- a/ewebsock/src/native_tungstenite_tokio.rs +++ b/ewebsock/src/native_tungstenite_tokio.rs @@ -53,7 +53,9 @@ async fn ws_connect_async( let uri: tungstenite::http::Uri = match url.parse() { Ok(uri) => uri, Err(err) => { - on_event(WsEvent::Error(err.to_string())); + on_event(WsEvent::Error(format!( + "Failed to parse URL {url:?}: {err}" + ))); return; } }; From 19ad569bbb9db9e7161af02ef1a99a705624e482 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Thu, 10 Oct 2024 14:08:28 +0200 Subject: [PATCH 25/25] document that this is native-only --- ewebsock/src/lib.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ewebsock/src/lib.rs b/ewebsock/src/lib.rs index 9ff78f4..e2be0c3 100644 --- a/ewebsock/src/lib.rs +++ b/ewebsock/src/lib.rs @@ -134,12 +134,17 @@ pub struct Options { /// Ignored on Web. pub max_incoming_frame_size: usize, - /// Additional Request headers + /// Additional Request headers. + /// + /// Currently only supported on native. pub additional_headers: Vec<(String, String)>, - /// Additional subprotocols - + /// Additional subprotocols. + /// /// /// + /// + /// Currently only supported on native. pub subprotocols: Vec, /// Delay blocking in ms - default 10ms