mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-01 00:00:10 +02:00
util: document cancel safety of SinkExt::send and StreamExt::next (#6417)
This commit is contained in:
@@ -18,8 +18,15 @@ pin_project! {
|
||||
/// For examples of how to use `FramedWrite` with a codec, see the
|
||||
/// examples on the [`codec`] module.
|
||||
///
|
||||
/// # Cancellation safety
|
||||
///
|
||||
/// * [`futures_util::sink::SinkExt::send`]: if send is used as the event in a
|
||||
/// `tokio::select!` statement and some other branch completes first, then it is
|
||||
/// guaranteed that the message was not sent, but the message itself is lost.
|
||||
///
|
||||
/// [`Sink`]: futures_sink::Sink
|
||||
/// [`codec`]: crate::codec
|
||||
/// [`futures_util::sink::SinkExt::send`]: futures_util::sink::SinkExt::send
|
||||
pub struct FramedWrite<T, E> {
|
||||
#[pin]
|
||||
inner: FramedImpl<T, E, WriteFrame>,
|
||||
|
||||
Reference in New Issue
Block a user