kafka_client_engine/consumer/assigned_host/next_event/
error.rs1#[derive(Clone, Copy, Debug, Eq, PartialEq)]
5pub enum AssignedConsumerNextEventErrorKind {
6 HostUnavailable,
8 InternalInvariant,
10}
11
12#[derive(Clone, Copy, Debug, Eq, PartialEq)]
14pub struct AssignedConsumerNextEventError {
15 kind: AssignedConsumerNextEventErrorKind,
16}
17
18impl AssignedConsumerNextEventError {
19 pub(super) const fn host_unavailable() -> Self {
20 Self {
21 kind: AssignedConsumerNextEventErrorKind::HostUnavailable,
22 }
23 }
24
25 pub(super) const fn internal_invariant() -> Self {
26 Self {
27 kind: AssignedConsumerNextEventErrorKind::InternalInvariant,
28 }
29 }
30
31 pub const fn kind(&self) -> AssignedConsumerNextEventErrorKind {
33 self.kind
34 }
35}
36
37impl std::fmt::Display for AssignedConsumerNextEventError {
38 fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
39 write!(
40 formatter,
41 "assigned-consumer event wait failed: {:?}",
42 self.kind
43 )
44 }
45}
46
47impl std::error::Error for AssignedConsumerNextEventError {}