pub enum Error<C: Connector, E: Debug> {
Open(C::OpenError),
Send(C::SendError),
Recv(C::RecvError),
EarlyClose,
Downcast,
Application(E),
}
Expand description
Server error when accepting a server streaming request
This combines network errors with application errors. Usually you don’t care about the exact nature of the error, but if you want to handle application errors differently, you can match on this enum.
Variants§
Open(C::OpenError)
Unable to open a substream at all
Send(C::SendError)
Unable to send the request to the server
Recv(C::RecvError)
Error received when creating the stream
EarlyClose
Connection was closed before receiving the first message
Downcast
Unexpected response from the server
Application(E)
Application error
Trait Implementations§
Source§impl<S: Connector, E: Debug> Error for Error<S, E>
impl<S: Connector, E: Debug> Error for Error<S, E>
1.30.0 · 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<C, E> Freeze for Error<C, E>where
<C as ConnectionErrors>::OpenError: Freeze,
<C as ConnectionErrors>::SendError: Freeze,
<C as ConnectionErrors>::RecvError: Freeze,
E: Freeze,
impl<C, E> RefUnwindSafe for Error<C, E>where
<C as ConnectionErrors>::OpenError: RefUnwindSafe,
<C as ConnectionErrors>::SendError: RefUnwindSafe,
<C as ConnectionErrors>::RecvError: RefUnwindSafe,
E: RefUnwindSafe,
impl<C, E> Send for Error<C, E>where
E: Send,
impl<C, E> Sync for Error<C, E>where
E: Sync,
impl<C, E> Unpin for Error<C, E>where
E: Unpin,
impl<C, E> UnwindSafe for Error<C, E>where
<C as ConnectionErrors>::OpenError: UnwindSafe,
<C as ConnectionErrors>::SendError: UnwindSafe,
<C as ConnectionErrors>::RecvError: UnwindSafe,
E: UnwindSafe,
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.