#[non_exhaustive]pub enum KrafkaError {
Network(Arc<Error>),
Protocol {
message: String,
},
Auth {
message: String,
},
Timeout {
operation: String,
},
Broker {
code: ErrorCode,
message: String,
},
Config {
message: String,
},
Compression {
message: String,
},
InvalidState {
message: String,
},
Serialization {
message: String,
},
SchemaRegistry {
message: String,
},
}Expand description
The main error type for Krafka operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Network(Arc<Error>)
Network-related errors (connection, I/O).
Wrapped in Arc so that cloning preserves the full error chain
(including raw_os_error() and source()).
Protocol
Protocol encoding/decoding errors.
Auth
Authentication errors.
Timeout
Timeout errors.
Broker
Broker errors returned by Kafka.
Config
Configuration errors.
Compression
Compression errors.
InvalidState
Invalid state errors.
Serialization
Serialization errors.
SchemaRegistry
Schema registry errors.
Implementations§
Source§impl KrafkaError
impl KrafkaError
Sourcepub fn compression(message: impl Into<String>) -> Self
pub fn compression(message: impl Into<String>) -> Self
Create a new compression error.
Sourcepub fn invalid_state(message: impl Into<String>) -> Self
pub fn invalid_state(message: impl Into<String>) -> Self
Create a new invalid state error.
Sourcepub fn serialization(message: impl Into<String>) -> Self
pub fn serialization(message: impl Into<String>) -> Self
Create a new serialization error.
Sourcepub fn schema_registry(message: impl Into<String>) -> Self
pub fn schema_registry(message: impl Into<String>) -> Self
Create a new schema registry error.
Sourcepub fn is_retriable(&self) -> bool
pub fn is_retriable(&self) -> bool
Returns true if this is a retriable error.
Trait Implementations§
Source§impl Clone for KrafkaError
impl Clone for KrafkaError
Source§impl Debug for KrafkaError
impl Debug for KrafkaError
Source§impl Display for KrafkaError
impl Display for KrafkaError
Source§impl Error for KrafkaError
impl Error for KrafkaError
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()
Auto Trait Implementations§
impl Freeze for KrafkaError
impl !RefUnwindSafe for KrafkaError
impl Send for KrafkaError
impl Sync for KrafkaError
impl Unpin for KrafkaError
impl UnsafeUnpin for KrafkaError
impl !UnwindSafe for KrafkaError
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.