#[non_exhaustive]pub enum NormalizeError {
Show 18 variants
MissingName,
InvalidName(String),
MissingScript,
ZeroInstances,
InvalidCron {
pattern: String,
reason: String,
},
InvalidTimezone {
name: String,
},
DuplicateName(String),
InvalidProbe {
probe: &'static str,
reason: String,
},
ZeroFailureThreshold {
probe: &'static str,
},
IntervalBelowMinimum {
probe: &'static str,
value: UpDuration,
min: UpDuration,
},
ZeroMaxMemory {
name: String,
},
ActionTimeoutTooLong {
name: String,
value: UpDuration,
max: UpDuration,
},
InvalidKillSignal {
name: String,
value: String,
},
WatchWithoutCwd {
name: String,
},
TildeUser {
name: String,
field: &'static str,
value: String,
},
NoHomeForTilde {
name: String,
field: &'static str,
},
ZeroWatchDelay {
name: String,
},
InvalidWatchGlob {
name: String,
field: &'static str,
pattern: String,
reason: String,
},
}Expand description
Error type returned from normalize and normalize_all
Growth is expected: every config surface this crate learns to validate brings its own rejection reasons with it (IR-20).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingName
name is empty
InvalidName(String)
name contains / or \ or is ./.. — it becomes a filesystem
path stem, so these would escape the shep home (carries the name)
MissingScript
script is empty
ZeroInstances
instances is zero
InvalidCron
cron_restart is not valid in croner’s dialect. Carries the pattern
and the rejection reason — croner’s own sentence where croner did the
rejecting, ours where shep’s pre-parse pass did.
InvalidTimezone
cron_timezone is not a name in the IANA time-zone database
DuplicateName(String)
Two apps in one flock share this name
InvalidProbe
A readiness_probe or liveness_probe target is malformed. Carries
which probe and the rendered reason.
Fields
probe: &'static str"readiness_probe" or "liveness_probe" — the Flockfile field
name, so the error names the line the user has to edit.
reason: StringProbeTarget::parse’s rendered rejection reason.
ZeroFailureThreshold
A readiness_probe or liveness_probe has failure_threshold == 0.
Fields
IntervalBelowMinimum
A readiness_probe or liveness_probe has an interval under the
floor its own loop in the daemon honours. At 0 that would spin the
loop as fast as the runtime allows; a liveness_probe under a full
second would instead be silently polled at that second.
Fields
probe: &'static str"readiness_probe" or "liveness_probe" — the Flockfile field
name, so the error names the line the user has to edit.
value: UpDurationThe value as the user wrote it.
min: UpDurationThe floor it failed.
ZeroMaxMemory
max_memory is 0 — a ceiling every live process is already over, so
the enforcer would restart the sheep on every poll forever. Carries
the app name.
ActionTimeoutTooLong
action_timeout is at or above normalize’s own ceiling — a wait no
RPC caller could ever be given enough deadline to outlast, since the
daemon clamps every deadline a caller can ask for. Carries the app
name, the value as written, and the ceiling it failed.
InvalidKillSignal
kill_signal names a signal the daemon’s stop ladder cannot send.
Carries the app name and the value as written.
Fields
WatchWithoutCwd
watch is enabled but the app sets no cwd, so there is no
directory to watch. Carries the app name.
TildeUser
A path begins ~user/, naming another user’s home.
Refused rather than resolved: answering it means a passwd lookup, and
under a systemd unit the answer is not obviously the one anyone meant.
~/ is supported; this is not.
Fields
NoHomeForTilde
A path begins ~/ and no home directory could be determined.
Fields
ZeroWatchDelay
watch_delay is 0, which would spin the debouncer’s own OS thread.
Carries the app name.
InvalidWatchGlob
A watch_options or ignore_watch pattern is one globset will not
compile, so the watch it describes could never be armed.
Trait Implementations§
Source§impl Clone for NormalizeError
impl Clone for NormalizeError
Source§fn clone(&self) -> NormalizeError
fn clone(&self) -> NormalizeError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NormalizeError
impl Debug for NormalizeError
Source§impl Display for NormalizeError
impl Display for NormalizeError
impl Eq for NormalizeError
Source§impl Error for NormalizeError
impl Error for NormalizeError
1.30.0 · 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 PartialEq for NormalizeError
impl PartialEq for NormalizeError
impl StructuralPartialEq for NormalizeError
Auto Trait Implementations§
impl Freeze for NormalizeError
impl RefUnwindSafe for NormalizeError
impl Send for NormalizeError
impl Sync for NormalizeError
impl Unpin for NormalizeError
impl UnsafeUnpin for NormalizeError
impl UnwindSafe for NormalizeError
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
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§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
key and return true if they are equal.