pub enum ControllerError {
Store(StoreError),
InvalidResource(String),
Shape(ShapeError),
Internal(String),
Reclaim(ReclaimError),
Panicked(PanicMessage),
}Variants§
Store(StoreError)
InvalidResource(String)
Shape(ShapeError)
A stored object has the wrong JSON type where a controller has to
write. Typed, not flattened into InvalidResource’s string, so the
path and the type found survive to the Event.
Internal(String)
Reclaim(ReclaimError)
A Released volume could not be reclaimed under its policy. Typed so its class is the variant’s, never its wording: an unreclaimable volume is Declarative, a deleter that failed this time is Transient.
Panicked(PanicMessage)
The tick panicked, and the driver contained it (T2.7).
Made only by the crate::WatchDriver around a whole tick of a
crate::TickState::Stateless child — never returned from inside a
controller. A Stateful child’s panic is not contained, so it never
becomes this: it ends the child.
Implementations§
Source§impl ControllerError
impl ControllerError
Sourcepub fn kind(&self) -> &'static str
pub fn kind(&self) -> &'static str
Stable identifier — see engenho_substrate::ErrorKind.
Source§impl ControllerError
impl ControllerError
Sourcepub const fn classify(&self) -> FailureKind
pub const fn classify(&self) -> FailureKind
Classify this error for the reconcile-loop retry decision.
Decided by the VARIANT, never by the message. Both matches below
are exhaustive with no wildcard, so a new ControllerError or
StoreError variant does not compile (E0004) until someone says
which class it is.
The previous shape rendered Store and Internal to a string and
ran it through shigoto_types::failure::classify’s signature list,
so the class hung on wording: a raft fatal or openraft config invalid store error was Transient (no signature matched, and the
default is Transient) and was retried forever, while an Internal
whose text happened to contain “does not exist” was dropped as
Declarative. The fleet classifier is right for what it was built
for — raw Nix and tool output, where the string is all there is.
Here the type already carries the answer.
InvalidResource— Declarative. A malformed declaration does not fix itself by being retried.Shape— Declarative, for the same reason: the object holds the wrong JSON type until someone edits it.Internal— Transient. It wraps I/O and serialization failures in a controller’s own work (provisioning a directory, copying a snapshot, a store round-trip); the conservative default, as in shigoto: an extra retry on the growing curve is cheaper than wedging a controller over a condition that would have cleared.Store— by [store_class].Reclaim— byReclaimError::class.Panicked— Declarative: no targeted retry. A panic is a bug meeting the data it trips on, and a retry a second later meets the same data. The next event (the data changed) or the fallback re-ticks it, so a panic costs one tick per fallback interval. Its owncrate::TickClass::Panickedkeeps it apart from a declaration that is merely malformed.
Source§impl ControllerError
impl ControllerError
Sourcepub const fn scope(&self) -> ErrorScope
pub const fn scope(&self) -> ErrorScope
How far this error’s damage reaches inside a sweep.
Decided by the VARIANT, like Self::classify, and by an
exhaustive match with no wildcard, so a new variant does not compile
(E0004) until someone says whether it may stop a sweep.
Store— Sweep, for everyStoreErrorbut the per-keySecretUnreadable; see [store_scope].InvalidResource,Shape— Item. One object’s declaration is malformed; its neighbours’ are not.Internal— Item. It wraps a controller’s own work on one object (a directory it provisions, a tree it copies).Reclaim— Item. It is one volume’s backing storage.Panicked— Sweep. The panic ended the whole tick, sweep and all; the driver makes it around the tick, never inside one.
Source§impl ControllerError
impl ControllerError
Sourcepub fn triage(self) -> Result<ItemFailure, SweepAbort>
pub fn triage(self) -> Result<ItemFailure, SweepAbort>
Split this error by scope: an Item error is kept
for its object, a Sweep error ends the sweep.
§Errors
SweepAbort when the scope is ErrorScope::Sweep.
Trait Implementations§
Source§impl Debug for ControllerError
impl Debug for ControllerError
Source§impl Display for ControllerError
impl Display for ControllerError
Source§impl Error for ControllerError
impl Error for ControllerError
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 ErrorKind for ControllerError
impl ErrorKind for ControllerError
Source§impl From<ReclaimError> for ControllerError
impl From<ReclaimError> for ControllerError
Source§fn from(source: ReclaimError) -> Self
fn from(source: ReclaimError) -> Self
Source§impl From<ShapeError> for ControllerError
impl From<ShapeError> for ControllerError
Source§fn from(source: ShapeError) -> Self
fn from(source: ShapeError) -> Self
Source§impl From<StoreError> for ControllerError
impl From<StoreError> for ControllerError
Source§fn from(source: StoreError) -> Self
fn from(source: StoreError) -> Self
Source§impl From<SweepAbort> for ControllerError
impl From<SweepAbort> for ControllerError
Source§fn from(abort: SweepAbort) -> Self
fn from(abort: SweepAbort) -> Self
Auto Trait Implementations§
impl !RefUnwindSafe for ControllerError
impl !UnwindSafe for ControllerError
impl Forget for ControllerError
impl Freeze for ControllerErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const StorageError<u64> is !null: Freeze,
PhantomData<StorageError<u64>>: Freeze,
PhantomData<&'static str>: Freeze,
*const () is !null: Freeze,
PhantomData<ErrorData<CustomOwner>>: Freeze,
impl Move for ControllerError
impl Send for ControllerError
impl Sync for ControllerError
impl Unpin for ControllerError
impl UnsafeUnpin for ControllerErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const StorageError<u64> is !null: UnsafeUnpin,
PhantomData<StorageError<u64>>: UnsafeUnpin,
PhantomData<&'static str>: UnsafeUnpin,
*const () is !null: UnsafeUnpin,
PhantomData<ErrorData<CustomOwner>>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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> ⓘ
impl<T> OptionalSend for T
impl<T> OptionalSync for T
Source§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§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();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§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();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§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();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§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();Source§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.
Source§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);