Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ impl<T> Sender<T> {
/// assert_eq!(s.send(2).await, Err(SendError(2)));
/// # });
/// ```
///
/// # Cancel safety
///
/// This method is **not** cancel safe (currently). The message passed in may be lost if the
/// returned future is dropped before polling to completion.
pub fn send(&self, msg: T) -> Send<'_, T> {
Send::_new(SendInner {
sender: self,
Expand Down Expand Up @@ -670,6 +675,11 @@ impl<T> Receiver<T> {
/// assert_eq!(r.recv().await, Err(RecvError));
/// # });
/// ```
///
/// # Cancel safety
///
/// This method is cancel safe. Dropping the returned future will not result in any lost
/// messages.
pub fn recv(&self) -> Recv<'_, T> {
Recv::_new(RecvInner {
receiver: self,
Expand Down