Struct OpaqueError
pub struct OpaqueError(/* private fields */);
Expand description
A type-erased error type that can be used as a trait object.
Note this type is not intended to be used directly,
it is used by rama
to hide the concrete error type.
See the module level documentation for more information.
Implementations§
§impl OpaqueError
impl OpaqueError
pub fn from_std(error: impl Error + Send + Sync + 'static) -> OpaqueError
pub fn from_std(error: impl Error + Send + Sync + 'static) -> OpaqueError
create an OpaqueError
from an std error
pub fn from_display(
msg: impl Display + Debug + Send + Sync + 'static,
) -> OpaqueError
pub fn from_display( msg: impl Display + Debug + Send + Sync + 'static, ) -> OpaqueError
create an OpaqueError
from a display object
pub fn from_boxed(inner: Box<dyn Error + Sync + Send>) -> OpaqueError
pub fn from_boxed(inner: Box<dyn Error + Sync + Send>) -> OpaqueError
create an OpaqueError
from a boxed error
pub fn is<T>(&self) -> boolwhere
T: Error + 'static,
pub fn is<T>(&self) -> boolwhere
T: Error + 'static,
Returns true if the underlying error is of type T
.
pub fn into_boxed(self) -> Box<dyn Error + Sync + Send>
pub fn into_boxed(self) -> Box<dyn Error + Sync + Send>
Consumes the OpaqueError
and returns it as a BoxError
.
pub fn downcast<T>(self) -> Result<T, OpaqueError>where
T: Error + 'static,
pub fn downcast<T>(self) -> Result<T, OpaqueError>where
T: Error + 'static,
Attempts to downcast the error to the concrete type T
.
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: Error + 'static,
pub fn downcast_ref<T>(&self) -> Option<&T>where
T: Error + 'static,
Attempts to downcast the error to a shared reference
of the concrete type T
.
pub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: Error + 'static,
pub fn downcast_mut<T>(&mut self) -> Option<&mut T>where
T: Error + 'static,
Attempts to downcast the error to the exclusive reference
of the concrete type T
.
Trait Implementations§
§impl Debug for OpaqueError
impl Debug for OpaqueError
§impl Display for OpaqueError
impl Display for OpaqueError
§impl Error for OpaqueError
impl Error for OpaqueError
§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()
§impl From<OpaqueError> for ClientError
impl From<OpaqueError> for ClientError
§fn from(value: OpaqueError) -> ClientError
fn from(value: OpaqueError) -> ClientError
Converts to this type from the input type.
§impl From<OpaqueError> for ProtocolError
impl From<OpaqueError> for ProtocolError
§fn from(value: OpaqueError) -> ProtocolError
fn from(value: OpaqueError) -> ProtocolError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OpaqueError
impl !RefUnwindSafe for OpaqueError
impl Send for OpaqueError
impl Sync for OpaqueError
impl Unpin for OpaqueError
impl !UnwindSafe for OpaqueError
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
Mutably borrows from an owned value. Read more
§impl<Error> ErrorExt for Error
impl<Error> ErrorExt for Error
§fn context<M>(self, context: M) -> OpaqueError
fn context<M>(self, context: M) -> OpaqueError
Wrap the error in a context. Read more
§fn with_context<C, F>(self, context: F) -> OpaqueError
fn with_context<C, F>(self, context: F) -> OpaqueError
Lazily wrap the error with a context. Read more
§fn backtrace(self) -> OpaqueError
fn backtrace(self) -> OpaqueError
§fn into_opaque(self) -> OpaqueError
fn into_opaque(self) -> OpaqueError
Convert the error into an
OpaqueError
. Read more§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> ⓘ
Converts
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> ⓘ
Converts
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> 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>
Create a new
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more§impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
type Error = <U as RamaTryFrom<T>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
impl<T, U> RamaTryInto<U> for Twhere
U: RamaTryFrom<T>,
type Error = <U as RamaTryFrom<T>>::Error
fn rama_try_into(self) -> Result<U, <U as RamaTryFrom<T>>::Error>
§impl<T> ToSmolStr for T
impl<T> ToSmolStr for T
fn to_smolstr(&self) -> SmolStr
§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.