Skip to content

Commit

Permalink
Merge pull request #32 from swimos/bounds
Browse files Browse the repository at this point in the history
Relaxes bounds when creating sockets
  • Loading branch information
SirCipher committed Jun 28, 2024
2 parents bbd9433 + 483779e commit ce819ff
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 16 deletions.
4 changes: 2 additions & 2 deletions ratchet_core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ratchet_core"
version = "1.0.1"
version = "1.0.2"
authors = ["Swim Inc. developers info@swim.ai"]
edition = "2021"
description = "Async WebSocket implementation"
Expand All @@ -16,7 +16,7 @@ split = ["futures"]
fixture = []

[dependencies]
ratchet_ext = { version = "1.0.1", path = "../ratchet_ext" }
ratchet_ext = { version = "1.0.2", path = "../ratchet_ext" }
url = { workspace = true }
http = { workspace = true }
tokio = { workspace = true, features = ["rt", "net", "io-util"] }
Expand Down
10 changes: 6 additions & 4 deletions ratchet_core/src/framed/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,7 @@ pub struct FramedIo<I> {
max_message_size: usize,
}

impl<I> FramedIo<I>
where
I: WebSocketStream,
{
impl<I> FramedIo<I> {
#[cfg(feature = "split")]
pub fn from_parts(parts: FramedIoParts<I>) -> FramedIo<I> {
let FramedIoParts {
Expand Down Expand Up @@ -497,7 +494,12 @@ where
pub fn is_server(&self) -> bool {
self.flags.contains(CodecFlags::ROLE)
}
}

impl<I> FramedIo<I>
where
I: WebSocketStream,
{
pub async fn flush(&mut self) -> Result<(), Error> {
self.io.flush().await?;
Ok(())
Expand Down
7 changes: 6 additions & 1 deletion ratchet_core/src/ws.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ pub enum CloseState {

impl<S, E> WebSocket<S, E>
where
S: WebSocketStream,
E: Extension,
{
#[cfg(feature = "split")]
Expand Down Expand Up @@ -144,7 +143,13 @@ where
close_state: CloseState::NotClosed,
}
}
}

impl<S, E> WebSocket<S, E>
where
S: WebSocketStream,
E: Extension,
{
/// Returns the role of this WebSocket.
pub fn role(&self) -> Role {
if self.framed.is_server() {
Expand Down
4 changes: 2 additions & 2 deletions ratchet_deflate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ratchet_deflate"
version = "1.0.1"
version = "1.0.2"
authors = ["Swim Inc. developers info@swim.ai"]
edition = "2021"
description = "Permessage Deflate for Ratchet"
Expand All @@ -11,7 +11,7 @@ readme = "README.md"
repository = "https://github.com/swimos/ratchet/"

[dependencies]
ratchet_ext = { version = "1.0.1", path = "../ratchet_ext" }
ratchet_ext = { version = "1.0.2", path = "../ratchet_ext" }
thiserror = { workspace = true }
http = { workspace = true }
bytes = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion ratchet_ext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ratchet_ext"
version = "1.0.1"
version = "1.0.2"
authors = ["Swim Inc. developers info@swim.ai"]
edition = "2021"
description = "WebSocket extensions for Ratchet"
Expand Down
4 changes: 2 additions & 2 deletions ratchet_fixture/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ratchet_fixture"
version = "1.0.1"
version = "1.0.2"
edition = "2021"
description = "Ratchet fixture"
keywords = ["websocket", "async", "futures", "tokio"]
Expand All @@ -10,7 +10,7 @@ readme = "README.md"
repository = "https://github.com/swimos/ratchet/"

[dependencies]
ratchet = { package = "ratchet_rs", version = "1.0.1", path = "../ratchet_rs", features = ["split", "deflate", "fixture"] }
ratchet = { package = "ratchet_rs", version = "1.0.2", path = "../ratchet_rs", features = ["split", "deflate", "fixture"] }
tokio = { workspace = true, features = ["io-util"] }
bytes = { workspace = true }
futures = { workspace = true }
Expand Down
8 changes: 4 additions & 4 deletions ratchet_rs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ratchet_rs"
version = "1.0.1"
version = "1.0.2"
authors = ["Swim Inc. developers info@swim.ai"]
edition = "2021"
description = "Async WebSocket implementation"
Expand All @@ -17,9 +17,9 @@ split = ["ratchet_core/split"]
fixture = ["ratchet_core/fixture"]

[dependencies]
ratchet_core = { version = "1.0.1", path = "../ratchet_core" }
ratchet_ext = { version = "1.0.1", path = "../ratchet_ext" }
ratchet_deflate = { version = "1.0.1", path = "../ratchet_deflate", optional = true }
ratchet_core = { version = "1.0.2", path = "../ratchet_core" }
ratchet_ext = { version = "1.0.2", path = "../ratchet_ext" }
ratchet_deflate = { version = "1.0.2", path = "../ratchet_deflate", optional = true }
tracing-subscriber = { workspace = true, features = ["env-filter"] }
log = { workspace = true }

Expand Down

0 comments on commit ce819ff

Please sign in to comment.