feat(connector): implement gzipped protobuf support for WASM and fix all warnings

This commit is contained in:
2025-09-09 02:30:16 -07:00
parent e4186a7ec0
commit d97f7507e8
6 changed files with 679 additions and 26 deletions
+10
View File
@@ -6,6 +6,7 @@ use thiserror::Error;
#[derive(Error, Debug)]
pub enum ConnectorError {
/// WebSocket connection failed
#[cfg(feature = "networking")]
#[error("WebSocket connection failed: {source}")]
ConnectionFailed {
#[from]
@@ -13,6 +14,7 @@ pub enum ConnectorError {
},
/// URL parsing error
#[cfg(feature = "networking")]
#[error("Invalid URL: {url}")]
InvalidUrl {
url: String,
@@ -124,8 +126,16 @@ impl ConnectorError {
message: message.into(),
}
}
/// Create a serialization error (wraps JSON error)
pub fn serialization_error(message: impl Into<String>) -> Self {
Self::ProtocolError {
message: message.into(),
}
}
}
#[cfg(feature = "networking")]
impl From<url::ParseError> for ConnectorError {
fn from(source: url::ParseError) -> Self {
Self::InvalidUrl {