Struct ClientError
pub struct ClientError { /* private fields */ }Expand description
Standard error returned from client operations.
Implementations§
§impl ClientError
impl ClientError
pub fn new(kind: ClientErrorKind, message: String) -> ClientError
pub fn new(kind: ClientErrorKind, message: String) -> ClientError
Construct a simple client error without source.
If you have an underlying error you want to include as the source, use ClientError::new_with_source instead.
pub fn new_with_source<S>(
kind: ClientErrorKind,
message: String,
source: Option<S>,
) -> ClientError
pub fn new_with_source<S>( kind: ClientErrorKind, message: String, source: Option<S>, ) -> ClientError
Construct a client error using an underlying error as the source.
pub fn with_details(self, details: String) -> ClientError
pub fn with_details(self, details: String) -> ClientError
Attach raw technical details (e.g. HTTP response body) to this error.
pub fn kind(&self) -> ClientErrorKind
pub fn kind(&self) -> ClientErrorKind
Error kind accessor.
pub fn take_details(&mut self) -> Option<String>
pub fn take_details(&mut self) -> Option<String>
Take the raw technical details out, leaving None in place.
Trait Implementations§
§impl Clone for ClientError
impl Clone for ClientError
§fn clone(&self) -> ClientError
fn clone(&self) -> ClientError
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ClientError
impl Debug for ClientError
§impl Display for ClientError
impl Display for ClientError
§impl Error for ClientError
impl Error for ClientError
§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<T> From<ClientError> for ClientResult<T>
impl<T> From<ClientError> for ClientResult<T>
§fn from(error: ClientError) -> ClientResult<T>
fn from(error: ClientError) -> ClientResult<T>
Converts to this type from the input type.
§impl From<ClientError> for Vec<ClientError>
impl From<ClientError> for Vec<ClientError>
§fn from(error: ClientError) -> Vec<ClientError>
fn from(error: ClientError) -> Vec<ClientError>
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ClientError
impl !RefUnwindSafe for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl !UnwindSafe for ClientError
Blanket Implementations§
§impl<T> ActionTrait for T
impl<T> ActionTrait for T
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§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.