pub enum ClientApiError {
Network {
code: ErrorCode,
message: String,
retry_after_ms: Option<u64>,
leader_hint: Option<LeaderHint>,
},
Protocol {
code: ErrorCode,
message: String,
supported_versions: Option<Vec<String>>,
},
Storage {
code: ErrorCode,
message: String,
},
Business {
code: ErrorCode,
message: String,
required_action: Option<String>,
},
General {
code: ErrorCode,
message: String,
required_action: Option<String>,
},
}Variants§
Network
Network layer error (retryable)
Protocol
Protocol layer error (client needs to check protocol compatibility)
Storage
Storage layer error (internal problem on the server)
Business
Business logic error (client needs to adjust behavior)
General
General Client API error
Implementations§
Source§impl ClientApiError
impl ClientApiError
pub fn general_client_error(message: String) -> Self
Trait Implementations§
Source§impl Clone for ClientApiError
impl Clone for ClientApiError
Source§fn clone(&self) -> ClientApiError
fn clone(&self) -> ClientApiError
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 moreSource§impl Debug for ClientApiError
impl Debug for ClientApiError
Source§impl<'de> Deserialize<'de> for ClientApiError
impl<'de> Deserialize<'de> for ClientApiError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ClientApiError
impl Display for ClientApiError
Source§impl Error for ClientApiError
impl Error for ClientApiError
1.30.0 · 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<ClientApiError> for KvClientError
Convert ClientApiError to KvClientError
impl From<ClientApiError> for KvClientError
Convert ClientApiError to KvClientError
Source§fn from(err: ClientApiError) -> Self
fn from(err: ClientApiError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for ClientApiError
impl From<Error> for ClientApiError
Source§fn from(err: Error) -> Self
fn from(err: Error) -> Self
Converts a tonic transport error into a ClientApiError
This implementation handles different transport error scenarios:
- Connection timeouts
- Invalid URI/address formats
- Unexpected connection loss
§Parameters
err: The tonic transport error to convert
§Returns
A ClientApiError with appropriate error code and retry information
Source§impl From<Error> for ClientApiError
impl From<Error> for ClientApiError
Source§impl From<ErrorCode> for ClientApiError
impl From<ErrorCode> for ClientApiError
Source§impl From<JoinError> for ClientApiError
impl From<JoinError> for ClientApiError
Source§impl From<Status> for ClientApiError
impl From<Status> for ClientApiError
Auto Trait Implementations§
impl Freeze for ClientApiError
impl RefUnwindSafe for ClientApiError
impl Send for ClientApiError
impl Sync for ClientApiError
impl Unpin for ClientApiError
impl UnwindSafe for ClientApiError
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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