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 + Sync + Send>>,
domain: ConnectionErrorDomain,
kind: ConnectionErrorKind,
) -> ConnectionError
pub fn new( source: impl Into<Box<dyn Error + Sync + Send>>, domain: ConnectionErrorDomain, kind: ConnectionErrorKind, ) -> ConnectionError
Create a classified connection error.
pub fn transport(
source: impl Into<Box<dyn Error + Sync + Send>>,
kind: ConnectionErrorKind,
) -> ConnectionError
pub fn transport( source: impl Into<Box<dyn Error + Sync + Send>>, kind: ConnectionErrorKind, ) -> ConnectionError
Create an error which occurred while establishing the transport path.
pub fn application(
source: impl Into<Box<dyn Error + Sync + Send>>,
kind: ConnectionErrorKind,
) -> ConnectionError
pub fn application( source: impl Into<Box<dyn Error + Sync + Send>>, 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 + Sync + Send>>,
kind: ConnectionErrorKind,
) -> ConnectionError
pub fn local( source: impl Into<Box<dyn Error + Sync + Send>>, kind: ConnectionErrorKind, ) -> ConnectionError
Create an error produced by client-local acquisition or orchestration machinery.
pub fn unknown(
source: impl Into<Box<dyn Error + Sync + Send>>,
) -> ConnectionError
pub fn unknown( source: impl Into<Box<dyn Error + Sync + Send>>, ) -> 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 + Sync + Send + 'static)
pub fn get_ref(&self) -> &(dyn Error + Sync + Send + 'static)
Return the original error, including any attached context.
pub fn into_source(self) -> Box<dyn Error + Sync + Send>
pub fn into_source(self) -> Box<dyn Error + Sync + Send>
Consume this error and return its boxed source.
pub fn into_box_error(self) -> Box<dyn Error + Sync + Send>
pub fn into_box_error(self) -> Box<dyn Error + Sync + Send>
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<HttpProxyError> for ConnectionError
impl From<HttpProxyError> for ConnectionError
§fn from(error: HttpProxyError) -> ConnectionError
fn from(error: HttpProxyError) -> ConnectionError
§impl From<Infallible> for ConnectionError
impl From<Infallible> for ConnectionError
§fn from(error: Infallible) -> ConnectionError
fn from(error: Infallible) -> 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<T> Conv for T
impl<T> Conv for T
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<Error> ErrorExt for Error
impl<Error> ErrorExt for Error
§fn into_box_error(self) -> Box<dyn Error + Sync + Send>
fn into_box_error(self) -> Box<dyn Error + Sync + Send>
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 + Sync + Send>
fn context_debug<M>(self, value: M) -> Box<dyn Error + Sync + Send>
fmt::Debug as fmt::Display.§fn context_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Sync + Send>
fn context_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Sync + Send>
§fn context_str_field<M>(
self,
key: &'static str,
value: M,
) -> Box<dyn Error + Sync + Send>
fn context_str_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Sync + Send>
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 + Sync + Send>
fn context_debug_field<M>( self, key: &'static str, value: M, ) -> Box<dyn Error + Sync + Send>
fmt::Debug as fmt::Display.§fn with_context<C, F>(self, cb: F) -> Box<dyn Error + Sync + Send>
fn with_context<C, F>(self, cb: F) -> Box<dyn Error + Sync + Send>
§fn with_context_debug<C, F>(self, cb: F) -> Box<dyn Error + Sync + Send>
fn with_context_debug<C, F>(self, cb: F) -> Box<dyn Error + Sync + Send>
fmt::Debug as fmt::Display.§fn with_context_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Sync + Send>
fn with_context_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Sync + Send>
§fn with_context_str_field<C, F>(
self,
key: &'static str,
cb: F,
) -> Box<dyn Error + Sync + Send>
fn with_context_str_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Sync + Send>
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 + Sync + Send>
fn with_context_debug_field<C, F>( self, key: &'static str, cb: F, ) -> Box<dyn Error + Sync + Send>
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> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§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> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.§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.