mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
sync: make SendError field public (#4097)
This commit is contained in:
@@ -123,9 +123,7 @@ pub mod error {
|
|||||||
|
|
||||||
/// Error produced when sending a value fails.
|
/// Error produced when sending a value fails.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct SendError<T> {
|
pub struct SendError<T>(pub T);
|
||||||
pub(crate) inner: T,
|
|
||||||
}
|
|
||||||
|
|
||||||
// ===== impl SendError =====
|
// ===== impl SendError =====
|
||||||
|
|
||||||
@@ -431,7 +429,7 @@ impl<T> Sender<T> {
|
|||||||
pub fn send(&self, value: T) -> Result<(), error::SendError<T>> {
|
pub fn send(&self, value: T) -> Result<(), error::SendError<T>> {
|
||||||
// This is pretty much only useful as a hint anyway, so synchronization isn't critical.
|
// This is pretty much only useful as a hint anyway, so synchronization isn't critical.
|
||||||
if 0 == self.receiver_count() {
|
if 0 == self.receiver_count() {
|
||||||
return Err(error::SendError { inner: value });
|
return Err(error::SendError(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user