pub enum ErasedSinkTrySendError {
Full,
Disconnected,
Other(Arc<dyn Error + Send + Sync + 'static>),
}
Expand description
Type-erased error for SinkTrySend::try_send
Provided for situations where providing a concrete error type is awkward.
futures::channel::mpsc::Sender
wants this because when its try_send
method fails,
it is not possible to extract both the sent item, and the error!
tor_memquota::mq_queue::Sender
wants this because the types of the error return
from its
try_sendwould otherwise be tainted by complex generics, including its private
Entry` type.
Variants§
Full
The stream was full.
No arrangements will have been made for a wakeup when space becomes available.
Corresponds to SinkTrySendError::is_full
Disconnected
The stream has disconnected
Corresponds to SinkTrySendError::is_disconnected
Other(Arc<dyn Error + Send + Sync + 'static>)
Something else went wrong
Implementations§
Source§impl ErasedSinkTrySendError
impl ErasedSinkTrySendError
Sourcepub fn from<E>(e: E) -> ErasedSinkTrySendError
pub fn from<E>(e: E) -> ErasedSinkTrySendError
Obtain an ErasedSinkTrySendError
from a concrete SinkTrySendError
Trait Implementations§
Source§impl Clone for ErasedSinkTrySendError
impl Clone for ErasedSinkTrySendError
Source§fn clone(&self) -> ErasedSinkTrySendError
fn clone(&self) -> ErasedSinkTrySendError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ErasedSinkTrySendError
impl Debug for ErasedSinkTrySendError
Source§impl Display for ErasedSinkTrySendError
impl Display for ErasedSinkTrySendError
Source§impl Error for ErasedSinkTrySendError
impl Error for ErasedSinkTrySendError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ErasedSinkTrySendError
impl !RefUnwindSafe for ErasedSinkTrySendError
impl Send for ErasedSinkTrySendError
impl Sync for ErasedSinkTrySendError
impl Unpin for ErasedSinkTrySendError
impl !UnwindSafe for ErasedSinkTrySendError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more