pub enum ClientError {
Connection {
msg: String,
},
Transport {
source: Error,
},
Grpc {
status: Box<Status>,
},
InvalidArgument {
msg: String,
},
InvalidTimestamp {
msg: String,
},
}Expand description
Errors that can occur during client operations.
Variants§
Connection
Failed to establish connection to the server.
Transport
Transport-level error from tonic.
Grpc
gRPC error from the server.
InvalidArgument
Invalid argument provided by caller.
InvalidTimestamp
Failed to parse timestamp.
Implementations§
Source§impl ClientError
impl ClientError
Sourcepub fn status(&self) -> Option<&Status>
pub fn status(&self) -> Option<&Status>
Returns the underlying gRPC Status if this is a gRPC error.
Sourcepub fn is_not_found(&self) -> bool
pub fn is_not_found(&self) -> bool
Returns true if this is a “not found” error.
Sourcepub fn is_precondition_failed(&self) -> bool
pub fn is_precondition_failed(&self) -> bool
Returns true if this is a “precondition failed” error.
Sourcepub fn is_invalid_argument(&self) -> bool
pub fn is_invalid_argument(&self) -> bool
Returns true if this is an “invalid argument” error.
Sourcepub fn is_connection_error(&self) -> bool
pub fn is_connection_error(&self) -> bool
Returns true if this is a connection or transport error.
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<Error> for ClientError
impl From<Error> for ClientError
Auto Trait Implementations§
impl Freeze for ClientError
impl !RefUnwindSafe for ClientError
impl Send for ClientError
impl Sync for ClientError
impl Unpin for ClientError
impl UnsafeUnpin 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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request