mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-29 00:00:11 +02:00
util: document cancel safety of SinkExt::send and StreamExt::next (#6417)
This commit is contained in:
@@ -17,9 +17,15 @@ pin_project! {
|
||||
/// For examples of how to use `FramedRead` with a codec, see the
|
||||
/// examples on the [`codec`] module.
|
||||
///
|
||||
/// # Cancellation safety
|
||||
/// * [`tokio_stream::StreamExt::next`]: This method is cancel safe. The returned
|
||||
/// future only holds onto a reference to the underlying stream, so dropping it will
|
||||
/// never lose a value.
|
||||
///
|
||||
/// [`Stream`]: futures_core::Stream
|
||||
/// [`AsyncRead`]: tokio::io::AsyncRead
|
||||
/// [`codec`]: crate::codec
|
||||
/// [`tokio_stream::StreamExt::next`]: https://docs.rs/tokio-stream/latest/tokio_stream/trait.StreamExt.html#method.next
|
||||
pub struct FramedRead<T, D> {
|
||||
#[pin]
|
||||
inner: FramedImpl<T, D, ReadFrame>,
|
||||
|
||||
Reference in New Issue
Block a user