Skip to content

Commit

Permalink
Clarify FragmentCollectorRead::read_frame(send_fn) closure documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-D-coder committed Oct 9, 2024
1 parent eadb437 commit 98bdb71
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/fragment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ impl<'f, S> FragmentCollectorRead<S> {
/// Reads a WebSocket frame, collecting fragmented messages until the final frame is received and returns the completed message.
///
/// Text frames payload is guaranteed to be valid UTF-8.
///
/// # Arguments
///
/// * `send_fn`: Closure must ensure frames are sent by write side of split WebSocket to correctly implement auto-close and auto-pong.
pub async fn read_frame<R, E>(
&mut self,
send_fn: &mut impl FnMut(Frame<'f>) -> R,
Expand Down

0 comments on commit 98bdb71

Please sign in to comment.