#[non_exhaustive]pub enum RaftError {
Show 30 variants
Storage(LogError),
Network(ClientError),
Protocol(ProtocolError),
ControllerAdmin(String),
Records(RecordsError),
MalformedControlRecord(&'static str),
Metadata(MetadataError),
Unsupported(&'static str),
NotLeader {
current_leader: Option<NodeId>,
},
LeaderUnknown,
ChangeRejected(String),
StaleMetadataImage,
UncommittedTail,
ClusterAuthorizationFailed,
ReconfigRejected(String),
ReconfigInProgress,
DuplicateVoter(NodeId),
VoterNotFound(NodeId),
InvalidVoterUpdate(String),
UnsupportedKraftVersion(u16),
VoterNotCaughtUp {
id: NodeId,
lag: u64,
},
SerdeFailed(WriteError),
SerdeFailedDecode(ReadError),
PersistedFormat {
artifact: &'static str,
path: PathBuf,
problem: PersistedFormatError,
},
UnsupportedPrivateVersion {
api_key: i16,
version: i16,
},
MetadataReplay(MetadataReplayError),
Startup(String),
ControllerListenerBind {
addr: SocketAddr,
source: Error,
},
FatalFault(String),
Shutdown,
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Storage(LogError)
Network(ClientError)
Protocol(ProtocolError)
ControllerAdmin(String)
Records(RecordsError)
MalformedControlRecord(&'static str)
A record of a control batch lacks its key or value, or has an empty
one. The message is the text of Kafka’s
RecordsIterator.decodeControlRecord.
Metadata(MetadataError)
Unsupported(&'static str)
NotLeader
LeaderUnknown
ChangeRejected(String)
StaleMetadataImage
A leader-local mutation was planned from an image that has since changed. The caller must read a fresh image and repeat its admission checks.
UncommittedTail
The leader refused a compare-and-set because its log holds records that are not committed yet.
A break-glass consume and a topic-freeze replacement check the
committed image, so the leader decides them only when its whole log is
committed. A newly elected leader is in this state until it commits a
record from its own epoch. Kafka’s controller is not active in the same
window, and it answers NOT_CONTROLLER. The refusal clears when the
tail commits, so a caller can retry.
A diskless offset reservation gets the same refusal until the leader has committed its own epoch. The leader reserves no offsets before that.
ClusterAuthorizationFailed
The controller refused a request because the principal of the connection lacks the cluster operation that the request needs.
ReconfigRejected(String)
ReconfigInProgress
DuplicateVoter(NodeId)
VoterNotFound(NodeId)
InvalidVoterUpdate(String)
UnsupportedKraftVersion(u16)
VoterNotCaughtUp
SerdeFailed(WriteError)
SerdeFailedDecode(ReadError)
PersistedFormat
A node-local file in the metadata partition directory has a version this build does not read, or does not parse. The node does not start on it.
Fields
problem: PersistedFormatErrorUnsupportedPrivateVersion
A peer answered a krabka-private controller RPC with
UNSUPPORTED_VERSION: it does not implement version of api_key.
A mixed-version cluster meets it during a rolling upgrade.
MetadataReplay(MetadataReplayError)
A committed metadata log record that this controller cannot replay. The controller stops.
Startup(String)
ControllerListenerBind
The controller listener could not bind its address. Kafka’s
SocketServer fails its start the same way, with Socket server failed to bind to and the address. It is a network failure, not a storage
one.
Fields
addr: SocketAddrThe address the listener tried to bind.
FatalFault(String)
The controller met a fault that Kafka’s ProcessTerminatingFaultHandler
halts the process over, such as a replay of a FeatureLevelRecord
above the range this controller supports. The text is the
Encountered fatal fault: prefix of that handler’s log line, then the
message of the exception that caused the fault. Kafka’s own
failureMessage between the two, such as Unable to apply FeatureLevelRecord record at offset N on active controller, ..., is
not part of it.
Shutdown
Trait Implementations§
Source§impl Error for RaftError
impl Error for RaftError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§impl From<MetadataError> for RaftError
impl From<MetadataError> for RaftError
Source§fn from(source: MetadataError) -> Self
fn from(source: MetadataError) -> Self
Source§impl From<MetadataReplayError> for RaftError
impl From<MetadataReplayError> for RaftError
Source§fn from(source: MetadataReplayError) -> Self
fn from(source: MetadataReplayError) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for RaftError
impl !UnwindSafe for RaftError
impl Freeze for RaftError
impl Send for RaftError
impl Sync for RaftError
impl Unpin for RaftError
impl UnsafeUnpin for RaftError
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<F> FnGhost for F
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling [Attribute] value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi [Quirk] value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the [Condition] value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);