Skip to content

Commit ce819ff

Browse files
authored
Merge pull request #32 from swimos/bounds
Relaxes bounds when creating sockets
2 parents bbd9433 + 483779e commit ce819ff

File tree

7 files changed

+23
-16
lines changed

7 files changed

+23
-16
lines changed

ratchet_core/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ratchet_core"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
authors = ["Swim Inc. developers [email protected]"]
55
edition = "2021"
66
description = "Async WebSocket implementation"
@@ -16,7 +16,7 @@ split = ["futures"]
1616
fixture = []
1717

1818
[dependencies]
19-
ratchet_ext = { version = "1.0.1", path = "../ratchet_ext" }
19+
ratchet_ext = { version = "1.0.2", path = "../ratchet_ext" }
2020
url = { workspace = true }
2121
http = { workspace = true }
2222
tokio = { workspace = true, features = ["rt", "net", "io-util"] }

ratchet_core/src/framed/mod.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,7 @@ pub struct FramedIo<I> {
433433
max_message_size: usize,
434434
}
435435

436-
impl<I> FramedIo<I>
437-
where
438-
I: WebSocketStream,
439-
{
436+
impl<I> FramedIo<I> {
440437
#[cfg(feature = "split")]
441438
pub fn from_parts(parts: FramedIoParts<I>) -> FramedIo<I> {
442439
let FramedIoParts {
@@ -497,7 +494,12 @@ where
497494
pub fn is_server(&self) -> bool {
498495
self.flags.contains(CodecFlags::ROLE)
499496
}
497+
}
500498

499+
impl<I> FramedIo<I>
500+
where
501+
I: WebSocketStream,
502+
{
501503
pub async fn flush(&mut self) -> Result<(), Error> {
502504
self.io.flush().await?;
503505
Ok(())

ratchet_core/src/ws.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ pub enum CloseState {
9696

9797
impl<S, E> WebSocket<S, E>
9898
where
99-
S: WebSocketStream,
10099
E: Extension,
101100
{
102101
#[cfg(feature = "split")]
@@ -144,7 +143,13 @@ where
144143
close_state: CloseState::NotClosed,
145144
}
146145
}
146+
}
147147

148+
impl<S, E> WebSocket<S, E>
149+
where
150+
S: WebSocketStream,
151+
E: Extension,
152+
{
148153
/// Returns the role of this WebSocket.
149154
pub fn role(&self) -> Role {
150155
if self.framed.is_server() {

ratchet_deflate/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ratchet_deflate"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
authors = ["Swim Inc. developers [email protected]"]
55
edition = "2021"
66
description = "Permessage Deflate for Ratchet"
@@ -11,7 +11,7 @@ readme = "README.md"
1111
repository = "https://github.com/swimos/ratchet/"
1212

1313
[dependencies]
14-
ratchet_ext = { version = "1.0.1", path = "../ratchet_ext" }
14+
ratchet_ext = { version = "1.0.2", path = "../ratchet_ext" }
1515
thiserror = { workspace = true }
1616
http = { workspace = true }
1717
bytes = { workspace = true }

ratchet_ext/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ratchet_ext"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
authors = ["Swim Inc. developers [email protected]"]
55
edition = "2021"
66
description = "WebSocket extensions for Ratchet"

ratchet_fixture/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ratchet_fixture"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
edition = "2021"
55
description = "Ratchet fixture"
66
keywords = ["websocket", "async", "futures", "tokio"]
@@ -10,7 +10,7 @@ readme = "README.md"
1010
repository = "https://github.com/swimos/ratchet/"
1111

1212
[dependencies]
13-
ratchet = { package = "ratchet_rs", version = "1.0.1", path = "../ratchet_rs", features = ["split", "deflate", "fixture"] }
13+
ratchet = { package = "ratchet_rs", version = "1.0.2", path = "../ratchet_rs", features = ["split", "deflate", "fixture"] }
1414
tokio = { workspace = true, features = ["io-util"] }
1515
bytes = { workspace = true }
1616
futures = { workspace = true }

ratchet_rs/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ratchet_rs"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
authors = ["Swim Inc. developers [email protected]"]
55
edition = "2021"
66
description = "Async WebSocket implementation"
@@ -17,9 +17,9 @@ split = ["ratchet_core/split"]
1717
fixture = ["ratchet_core/fixture"]
1818

1919
[dependencies]
20-
ratchet_core = { version = "1.0.1", path = "../ratchet_core" }
21-
ratchet_ext = { version = "1.0.1", path = "../ratchet_ext" }
22-
ratchet_deflate = { version = "1.0.1", path = "../ratchet_deflate", optional = true }
20+
ratchet_core = { version = "1.0.2", path = "../ratchet_core" }
21+
ratchet_ext = { version = "1.0.2", path = "../ratchet_ext" }
22+
ratchet_deflate = { version = "1.0.2", path = "../ratchet_deflate", optional = true }
2323
tracing-subscriber = { workspace = true, features = ["env-filter"] }
2424
log = { workspace = true }
2525

0 commit comments

Comments
 (0)