pub struct ClientError { /* private fields */ }Available on crate feature
client only.Expand description
Generic client error
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn new<E>(kind: ErrorKind, error: Option<E>) -> Self
pub fn new<E>(kind: ErrorKind, error: Option<E>) -> Self
Create a new ClientError using the given ErrorKind and Error
Sourcepub fn set_url(&mut self, uri: Uri)
pub fn set_url(&mut self, uri: Uri)
Set a Uri to the ClientError.
Sourcepub fn set_addr(&mut self, addr: SocketAddr)
pub fn set_addr(&mut self, addr: SocketAddr)
Set a SocketAddr to the ClientError.
Sourcepub fn with_url(self, uri: Uri) -> Self
pub fn with_url(self, uri: Uri) -> Self
Consume current ClientError and return a new one with given Uri.
Sourcepub fn without_url(self) -> Self
pub fn without_url(self) -> Self
Remove Uri from the ClientError.
Sourcepub fn with_addr(self, addr: SocketAddr) -> Self
pub fn with_addr(self, addr: SocketAddr) -> Self
Consume current ClientError and return a new one with given SocketAddr.
Sourcepub fn with_address(self, address: Address) -> Self
pub fn with_address(self, address: Address) -> Self
Consume current ClientError and return a new one with SocketAddr from the
Address if exists.
Sourcepub fn with_endpoint(self, ep: &Endpoint) -> Self
pub fn with_endpoint(self, ep: &Endpoint) -> Self
Consume current ClientError and return a new one with SocketAddr from the
Address if exists.
Sourcepub fn addr(&self) -> Option<&SocketAddr>
pub fn addr(&self) -> Option<&SocketAddr>
Get a reference to the SocketAddr if it exists
Trait Implementations§
Source§impl Debug for ClientError
impl Debug for ClientError
Source§impl Display for ClientError
impl Display for ClientError
Source§impl Error for ClientError
impl Error for ClientError
Source§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()
Source§impl From<BodyConvertError> for ClientError
impl From<BodyConvertError> for ClientError
Source§fn from(value: BodyConvertError) -> Self
fn from(value: BodyConvertError) -> Self
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§
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