Skip to content

Commit 1c92fae

Browse files
committed
docs: added some docs
Signed-off-by: Jad K. Haddad <jadkhaddad@gmail.com>
1 parent c6e6a14 commit 1c92fae

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/close_frame.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ impl<'a> CloseFrame<'a> {
1414
Self { code, reason }
1515
}
1616

17+
/// Creates a new [`CloseFrame`] with no reason.
1718
pub const fn no_reason(code: CloseCode) -> Self {
1819
Self::new(code, "")
1920
}

src/options.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub enum ConnectOptionsError {
1010
#[non_exhaustive]
1111
pub struct ConnectOptions<'a, 'b> {
1212
/// Must not be empty
13-
pub path: &'a str,
13+
pub(crate) path: &'a str,
1414
pub headers: &'a [Header<'b>],
1515
}
1616

src/websocket.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -236,19 +236,22 @@ impl<'buf, RW, Rng> WebSocket<'buf, RW, Rng> {
236236
self.core.send_fragmented(message, fragment_size).await
237237
}
238238

239-
/// Splits the [`WebSocket`] into a [`WebSocketRead`] and a [`WebSocketWrite`].
239+
/// Splits the [`WebSocket`] into a [`WebSocketRead`] and a [`WebSocketWrite`] with the provided `split` function.
240240
///
241241
/// # Note
242242
///
243243
/// `auto_pong` and `auto_close` will `NOT` be applied to the split instances.
244-
pub fn split_with<F, R, W>(self, f: F) -> (WebSocketRead<'buf, R>, WebSocketWrite<'buf, W, Rng>)
244+
pub fn split_with<F, R, W>(
245+
self,
246+
split: F,
247+
) -> (WebSocketRead<'buf, R>, WebSocketWrite<'buf, W, Rng>)
245248
where
246249
F: FnOnce(RW) -> (R, W),
247250
{
248251
let (codec, inner, state) = self.core.framed.into_parts();
249252
let (read_codec, write_codec) = codec.split();
250253

251-
let (read, write) = f(inner);
254+
let (read, write) = split(inner);
252255

253256
let framed_read = Framed::from_parts(
254257
read_codec,

0 commit comments

Comments
 (0)