Skip to content

Commit 35d110c

Browse files
hi-abhiAbhishek Kumar
andauthored
Implement into_inner to get the underlying stream (#367)
Co-authored-by: Abhishek Kumar <[email protected]>
1 parent f3ae75d commit 35d110c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/compat.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,11 @@ impl<S> AllowStd<S> {
9696
}
9797
}
9898
}
99+
100+
/// Returns the underlying stream.
101+
pub(crate) fn into_inner(self) -> S {
102+
self.inner
103+
}
99104
}
100105

101106
// Proxy Waker that we pass to the internal AsyncRead/Write of the

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,11 @@ impl<S> WebSocketStream<S> {
247247
f(&mut self.inner)
248248
}
249249

250+
/// Consumes the `WebSocketStream` and returns the underlying stream.
251+
pub fn into_inner(self) -> S {
252+
self.inner.into_inner().into_inner()
253+
}
254+
250255
/// Returns a shared reference to the inner stream.
251256
pub fn get_ref(&self) -> &S
252257
where

0 commit comments

Comments
 (0)