Struct ConnectionError
pub struct ConnectionError { /* private fields */ }net only.Expand description
A classified error produced while establishing a client connection.
The original error remains available as the source. Adding context only wraps that source and therefore preserves the classification.
Implementations§
§impl ConnectionError
impl ConnectionError
pub fn new(
source: impl Into<Box<dyn Error + Send + Sync>>,
domain: ConnectionErrorDomain,
kind: ConnectionErrorKind,
) -> ConnectionError
pub fn new( source: impl Into<Box<dyn Error + Send + Sync>>, domain: ConnectionErrorDomain, kind: ConnectionErrorKind, ) -> ConnectionError
Create a classified connection error.
pub fn transport(
source: impl Into<Box<dyn Error + Send + Sync>>,
kind: ConnectionErrorKind,
) -> ConnectionError
pub fn transport( source: impl Into<Box<dyn Error + Send + Sync>>, kind: ConnectionErrorKind, ) -> ConnectionError
Create an error which occurred while establishing the transport path.
pub fn application(
source: impl Into<Box<dyn Error + Send + Sync>>,
kind: ConnectionErrorKind,
) -> ConnectionError
pub fn application( source: impl Into<Box<dyn Error + Send + Sync>>, kind: ConnectionErrorKind, ) -> ConnectionError
Create an error which occurred while establishing the end-to-end connection.
This includes intermediate end-to-end protocols such as TLS to the origin, not only the final application protocol.
pub fn local(
source: impl Into<Box<dyn Error + Send + Sync>>,
kind: ConnectionErrorKind,
) -> ConnectionError
pub fn local( source: impl Into<Box<dyn Error + Send + Sync>>, kind: ConnectionErrorKind, ) -> ConnectionError
Create an error produced by client-local acquisition or orchestration machinery.
pub fn unknown(
source: impl Into<Box<dyn Error + Send + Sync>>,
) -> ConnectionError
pub fn unknown( source: impl Into<Box<dyn Error + Send + Sync>>, ) -> ConnectionError
Create an unclassified connection error.
pub fn domain(&self) -> ConnectionErrorDomain
pub fn domain(&self) -> ConnectionErrorDomain
Return the architectural domain in which the failure occurred.
pub fn kind(&self) -> ConnectionErrorKind
pub fn kind(&self) -> ConnectionErrorKind
Return the protocol-independent kind of failure.
pub fn get_ref(&self) -> &(dyn Error + Send + Sync + 'static)
pub fn get_ref(&self) -> &(dyn Error + Send + Sync + 'static)
Return the original error, including any attached context.
pub fn into_source(self) -> Box<dyn Error + Send + Sync>
pub fn into_source(self) -> Box<dyn Error + Send + Sync>
Consume this error and return its boxed source.
pub fn into_box_error(self) -> Box<dyn Error + Send + Sync>
pub fn into_box_error(self) -> Box<dyn Error + Send + Sync>
Convert this error into a BoxError without losing its classification.
pub fn into_opaque_error(self) -> OpaqueError
pub fn into_opaque_error(self) -> OpaqueError
Convert this error into an OpaqueError without losing its classification.
pub fn context<M>(self, value: M) -> ConnectionError
pub fn context<M>(self, value: M) -> ConnectionError
Add context to the source error.
pub fn context_hex<M>(self, value: M) -> ConnectionError
pub fn context_hex<M>(self, value: M) -> ConnectionError
Add context using fmt::LowerHex for its formatting.
pub fn context_debug<M>(self, value: M) -> ConnectionError
pub fn context_debug<M>(self, value: M) -> ConnectionError
Add context using fmt::Debug for its display formatting.
pub fn context_field<M>(self, key: &'static str, value: M) -> ConnectionError
pub fn context_field<M>(self, key: &'static str, value: M) -> ConnectionError
Add keyed context to the source error.
pub fn context_str_field<M>(
self,
key: &'static str,
value: M,
) -> ConnectionError
pub fn context_str_field<M>( self, key: &'static str, value: M, ) -> ConnectionError
Add a keyed string-like context value to the source error.
pub fn context_hex_field<M>(
self,
key: &'static str,
value: M,
) -> ConnectionError
pub fn context_hex_field<M>( self, key: &'static str, value: M, ) -> ConnectionError
Add keyed context using fmt::LowerHex for its formatting.
pub fn context_debug_field<M>(
self,
key: &'static str,
value: M,
) -> ConnectionError
pub fn context_debug_field<M>( self, key: &'static str, value: M, ) -> ConnectionError
Add keyed context using fmt::Debug for its display formatting.
pub fn with_context<C, F>(self, create: F) -> ConnectionError
pub fn with_context<C, F>(self, create: F) -> ConnectionError
Lazily add context to the source error.
pub fn with_context_hex<C, F>(self, create: F) -> ConnectionError
pub fn with_context_hex<C, F>(self, create: F) -> ConnectionError
Lazily add context using fmt::LowerHex for its formatting.
pub fn with_context_debug<C, F>(self, create: F) -> ConnectionError
pub fn with_context_debug<C, F>(self, create: F) -> ConnectionError
Lazily add context using fmt::Debug for its display formatting.
pub fn with_context_field<C, F>(
self,
key: &'static str,
create: F,
) -> ConnectionError
pub fn with_context_field<C, F>( self, key: &'static str, create: F, ) -> ConnectionError
Lazily add keyed context to the source error.
pub fn with_context_str_field<C, F>(
self,
key: &'static str,
create: F,
) -> ConnectionError
pub fn with_context_str_field<C, F>( self, key: &'static str, create: F, ) -> ConnectionError
Lazily add a keyed string-like context value to the source error.
pub fn with_context_hex_field<C, F>(
self,
key: &'static str,
create: F,
) -> ConnectionError
pub fn with_context_hex_field<C, F>( self, key: &'static str, create: F, ) -> ConnectionError
Lazily add keyed context using fmt::LowerHex for its formatting.
pub fn with_context_debug_field<C, F>(
self,
key: &'static str,
create: F,
) -> ConnectionError
pub fn with_context_debug_field<C, F>( self, key: &'static str, create: F, ) -> ConnectionError
Lazily add keyed context using fmt::Debug for its display formatting.
pub fn backtrace(self) -> ConnectionError
pub fn backtrace(self) -> ConnectionError
Capture a backtrace and attach it to the source error.
Trait Implementations§
§impl Debug for ConnectionError
impl Debug for ConnectionError
§impl Display for ConnectionError
impl Display for ConnectionError
§impl Error for ConnectionError
impl Error for ConnectionError
§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
§impl From<!> for ConnectionError
impl From<!> for ConnectionError
§fn from(error: !) -> ConnectionError
fn from(error: !) -> ConnectionError
§impl From<HttpProxyError> for ConnectionError
impl From<HttpProxyError> for ConnectionError
§fn from(error: HttpProxyError) -> ConnectionError
fn from(error: HttpProxyError) -> ConnectionError
§impl From<Socks5ProxyError> for ConnectionError
impl From<Socks5ProxyError> for ConnectionError
§fn from(error: Socks5ProxyError) -> ConnectionError
fn from(error: Socks5ProxyError) -> ConnectionError
Auto Trait Implementations§
impl !RefUnwindSafe for ConnectionError
impl !UnwindSafe for ConnectionError
impl Freeze for ConnectionError
impl Send for ConnectionError
impl Sync for ConnectionError
impl Unpin for ConnectionError
impl UnsafeUnpin for ConnectionError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<Error> ErrorExt for Error
impl<Error> ErrorExt for Error
§fn into_box_error(self) -> Box<dyn Error + Send + Sync>
fn into_box_error(self) -> Box<dyn Error + Send + Sync>
BoxError without additional context.§fn into_opaque_error(self) -> OpaqueError
fn into_opaque_error(self) -> OpaqueError
OpaqueError without additional context. Read more§fn context_debug<M>(self, value: M) -> Box<dyn Error + Send + Sync>
fn context_debug<M>(self, value: M) -> Box<dyn Error + Send + Sync>
fmt::Debug as fmt::Display.§fn context_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Send + Sync>
fn context_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Send + Sync>
§fn context_str_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Send + Sync>
fn context_str_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Send + Sync>
Self::context_field but using a string-like value,
this is useful in case you need to pass a string slice which is borrowed
and thus cannot be passed as part of ’static error.§fn context_debug_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Send + Sync>
fn context_debug_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Send + Sync>
fmt::Debug as fmt::Display.§fn with_context<C, F>(self, cb: F) -> Box<dyn Error + Send + Sync>
fn with_context<C, F>(self, cb: F) -> Box<dyn Error + Send + Sync>
§fn with_context_debug<C, F>(self, cb: F) -> Box<dyn Error + Send + Sync>
fn with_context_debug<C, F>(self, cb: F) -> Box<dyn Error + Send + Sync>
fmt::Debug as fmt::Display.§fn with_context_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Send + Sync>
fn with_context_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Send + Sync>
§fn with_context_str_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Send + Sync>
fn with_context_str_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Send + Sync>
Self::with_context_field but using a string-like value,
this is useful in case you need to pass a string slice which is borrowed
and thus cannot be passed as part of ’static error.§fn with_context_debug_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Send + Sync>
fn with_context_debug_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Send + Sync>
fmt::Debug as fmt::Display.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more§impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
impl<T, U> RamaTryFrom<T> for Uwhere
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
fn rama_try_from(value: T) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
impl<T, U, CrateMarker> RamaTryInto<U, CrateMarker> for Twhere
U: RamaTryFrom<T, CrateMarker>,
type Error = <U as RamaTryFrom<T, CrateMarker>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T, CrateMarker>>::Error>
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.