Skip to content

Commit d529f10

Browse files
committed
streaming: next_frame
1 parent 4e030e2 commit d529f10

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/native/streaming.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
5151
use std::{
5252
collections::VecDeque,
53+
future::poll_fn,
5354
pin::Pin,
5455
sync::Arc,
5556
task::{ready, Context, Poll},
@@ -192,6 +193,11 @@ where
192193
}
193194
}
194195

196+
/// Asynchronously retrieves the next frame from the WebSocket stream.
197+
pub async fn next_frame(&mut self) -> Result<Frame> {
198+
poll_fn(|cx| self.poll_next_frame(cx)).await
199+
}
200+
195201
/// Splits the `Streaming` connection into its low-level components for advanced usage.
196202
///
197203
/// This method provides access to the underlying framed stream and read/write halves,

0 commit comments

Comments
 (0)