mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
sync: deprecate mpsc::RecvError (#3833)
This commit is contained in:
@@ -65,7 +65,7 @@ pub struct Receiver<T> {
|
|||||||
/// with backpressure.
|
/// with backpressure.
|
||||||
///
|
///
|
||||||
/// The channel will buffer up to the provided number of messages. Once the
|
/// The channel will buffer up to the provided number of messages. Once the
|
||||||
/// buffer is full, attempts to `send` new messages will wait until a message is
|
/// buffer is full, attempts to send new messages will wait until a message is
|
||||||
/// received from the channel. The provided buffer capacity must be at least 1.
|
/// received from the channel. The provided buffer capacity must be at least 1.
|
||||||
///
|
///
|
||||||
/// All data sent on `Sender` will become available on `Receiver` in the same
|
/// All data sent on `Sender` will become available on `Receiver` in the same
|
||||||
@@ -76,7 +76,7 @@ pub struct Receiver<T> {
|
|||||||
///
|
///
|
||||||
/// If the `Receiver` is disconnected while trying to `send`, the `send` method
|
/// If the `Receiver` is disconnected while trying to `send`, the `send` method
|
||||||
/// will return a `SendError`. Similarly, if `Sender` is disconnected while
|
/// will return a `SendError`. Similarly, if `Sender` is disconnected while
|
||||||
/// trying to `recv`, the `recv` method will return a `RecvError`.
|
/// trying to `recv`, the `recv` method will return `None`.
|
||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -55,14 +55,18 @@ impl<T> From<SendError<T>> for TrySendError<T> {
|
|||||||
|
|
||||||
/// Error returned by `Receiver`.
|
/// Error returned by `Receiver`.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
#[doc(hidden)]
|
||||||
|
#[deprecated(note = "This type is unused because recv returns an Option.")]
|
||||||
pub struct RecvError(());
|
pub struct RecvError(());
|
||||||
|
|
||||||
|
#[allow(deprecated)]
|
||||||
impl fmt::Display for RecvError {
|
impl fmt::Display for RecvError {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
write!(fmt, "channel closed")
|
write!(fmt, "channel closed")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(deprecated)]
|
||||||
impl Error for RecvError {}
|
impl Error for RecvError {}
|
||||||
|
|
||||||
cfg_time! {
|
cfg_time! {
|
||||||
|
|||||||
Reference in New Issue
Block a user