#[repr(i32)]pub enum ErrorCode {
Show 23 variants
Success = 0,
ConnectionTimeout = 1_001,
InvalidAddress = 1_002,
LeaderChanged = 1_003,
JoinError = 1_004,
InvalidResponse = 2_001,
VersionMismatch = 2_002,
DiskFull = 3_001,
DataCorruption = 3_002,
StorageIoError = 3_003,
StoragePermissionDenied = 3_004,
KeyNotExist = 3_005,
NotLeader = 4_001,
StaleOperation = 4_002,
InvalidRequest = 4_003,
RateLimited = 4_004,
ClusterUnavailable = 4_005,
ProposeFailed = 4_006,
TermOutdated = 4_007,
RetryRequired = 4_008,
WatchBufferOverflow = 5_001,
General = 8_888,
Uncategorized = 9_999,
}Expand description
Client-facing error codes — transport-agnostic, mirrors proto ErrorCode.
Values are intentionally kept in sync with proto so that server-layer
conversions (core::ErrorCode ↔ proto::ErrorCode) are trivial numeric casts.
If a new variant is added here, add it to proto’s .proto file too.
Variants§
Success = 0
ConnectionTimeout = 1_001
InvalidAddress = 1_002
LeaderChanged = 1_003
JoinError = 1_004
InvalidResponse = 2_001
VersionMismatch = 2_002
DiskFull = 3_001
DataCorruption = 3_002
StorageIoError = 3_003
StoragePermissionDenied = 3_004
KeyNotExist = 3_005
NotLeader = 4_001
StaleOperation = 4_002
InvalidRequest = 4_003
RateLimited = 4_004
ProposeFailed = 4_006
TermOutdated = 4_007
RetryRequired = 4_008
WatchBufferOverflow = 5_001
General = 8_888
Uncategorized = 9_999
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ErrorCode
impl<'de> Deserialize<'de> for ErrorCode
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ErrorCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ErrorCode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<ErrorCode> for ClientApiError
impl From<ErrorCode> for ClientApiError
Source§fn from(code: ErrorCode) -> ClientApiError
fn from(code: ErrorCode) -> ClientApiError
Converts to this type from the input type.
Source§impl Serialize for ErrorCode
impl Serialize for ErrorCode
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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