pub enum TlsError<TlsErr, SvcErr> {
Timeout,
Tls(TlsErr),
Service(SvcErr),
}
This is supported on crate feature
accept
only.Expand description
TLS handshake error, TLS timeout, or inner service error.
All TLS acceptors from this crate will return the SvcErr
type parameter as Infallible
,
which can be cast to your own service type, inferred or otherwise, using into_service_error
.
Variants
Timeout
TLS handshake has timed-out.
Tls(TlsErr)
Wraps TLS service errors.
Service(SvcErr)
Wraps service errors.
Implementations
sourceimpl<TlsErr> TlsError<TlsErr, Infallible>
impl<TlsErr> TlsError<TlsErr, Infallible>
sourcepub fn into_service_error<SvcErr>(self) -> TlsError<TlsErr, SvcErr>
pub fn into_service_error<SvcErr>(self) -> TlsError<TlsErr, SvcErr>
Casts the infallible service error type returned from acceptors into caller’s type.
Examples
let a: TlsError<u32, Infallible> = TlsError::Tls(42);
let _b: TlsError<u32, u64> = a.into_service_error();
Trait Implementations
sourceimpl<TlsErr, SvcErr> Error for TlsError<TlsErr, SvcErr> where
TlsErr: Error + 'static,
SvcErr: Error + 'static,
impl<TlsErr, SvcErr> Error for TlsError<TlsErr, SvcErr> where
TlsErr: Error + 'static,
SvcErr: Error + 'static,
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
🔬 This is a nightly-only experimental API. (
backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎 Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations
impl<TlsErr, SvcErr> RefUnwindSafe for TlsError<TlsErr, SvcErr> where
SvcErr: RefUnwindSafe,
TlsErr: RefUnwindSafe,
impl<TlsErr, SvcErr> Send for TlsError<TlsErr, SvcErr> where
SvcErr: Send,
TlsErr: Send,
impl<TlsErr, SvcErr> Sync for TlsError<TlsErr, SvcErr> where
SvcErr: Sync,
TlsErr: Sync,
impl<TlsErr, SvcErr> Unpin for TlsError<TlsErr, SvcErr> where
SvcErr: Unpin,
TlsErr: Unpin,
impl<TlsErr, SvcErr> UnwindSafe for TlsError<TlsErr, SvcErr> where
SvcErr: UnwindSafe,
TlsErr: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more