#[non_exhaustive]pub enum ResetDepth {
None,
File,
Policy,
Env,
All,
}Expand description
How much of a Flockfile load overwrites what the operator has set since.
A mode touches what its name says, and the design spec
(2026-09-02-config-overrides-design.md §3) states each variant against
three columns rather than two: whether env is reset, whether a key the
template declares is reset, and whether a key it does not declare is.
Not a two-by-two grid, and an earlier version of this comment said it
was. There are two independent choices, but the settings one has three
settings rather than two – untouched, declared only, or everything –
which makes six combinations. These four are the ones worth having. One
discarded combination resets nothing at all, so it is the additive
default with extra typing. The other is File plus Env: reset env,
and reset only what the template declares, sparing everything it does
not. That one is coherent, not useless, and is left out only because
nobody has asked for it.
#[non_exhaustive]: no fifth depth is anticipated, and the attribute buys
SOURCE compatibility rather than wire compatibility. It forces a crate
outside this one to carry a wildcard arm, so adding a variant does not
break its build. It does nothing for serde, which is worth stating because
an earlier version of this comment claimed otherwise: this enum carries no
#[serde(other)], so a build meeting a variant it predates fails to
deserialize with unknown variant, measured rather than assumed. That is
the whole reason renaming Settings to Policy moved PROTOCOL_VERSION
to 3 instead of riding the additive precedent.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
None
Append keys nobody established. Overwrite nothing. The default, because a Flockfile arrives from the app’s own repository.
env: kept. A key the template declares: kept, unless nobody has
established it yet, which is the append. A key it does not declare:
kept, since there is nothing to append it against.
File
Put back what the template declares, and nothing else.
env: kept. A key the template declares: reset. A key it does not
declare: kept – an app stocked to four instances against a file with
no instances line keeps its count, because the file never entered
that argument. This is the mode that fixes the footgun Policy below
reintroduces.
Policy
Put non-env settings back to the template, env kept. Every
setting goes back, declared or not: a key the template is silent
about goes to the value a fresh start off that template would give
it. env is operator-supplied data while the rest is operator-tuned
policy: resetting policy is recoverable, resetting data takes the
app’s database away.
env: kept. A key the template declares: reset. A key it does not
declare: reset too, to the template’s own default.
Env
Reset env back to the template and leave everything else alone.
This mode touches data, not policy, so it has no opinion about any
setting: a restart budget the template happens to mention is not the
operator’s to lose to a flag that says env. On the settings axis it
is therefore None, append included, because the flag widens a load
rather than narrowing one.
env: reset. A key the template declares: kept, save for the same
append None does. A key it does not declare: kept.
All
Put everything back to the template, env included, and drop the
override record.
env: reset. A key the template declares: reset. A key it does not
declare: reset too, to the template’s own default.
Trait Implementations§
Source§impl Clone for ResetDepth
impl Clone for ResetDepth
Source§fn clone(&self) -> ResetDepth
fn clone(&self) -> ResetDepth
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ResetDepth
Source§impl Debug for ResetDepth
impl Debug for ResetDepth
Source§impl Default for ResetDepth
impl Default for ResetDepth
Source§fn default() -> ResetDepth
fn default() -> ResetDepth
Source§impl<'de> Deserialize<'de> for ResetDepth
impl<'de> Deserialize<'de> for ResetDepth
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ResetDepth
Source§impl PartialEq for ResetDepth
impl PartialEq for ResetDepth
Source§impl Serialize for ResetDepth
impl Serialize for ResetDepth
impl StructuralPartialEq for ResetDepth
Auto Trait Implementations§
impl Freeze for ResetDepth
impl RefUnwindSafe for ResetDepth
impl Send for ResetDepth
impl Sync for ResetDepth
impl Unpin for ResetDepth
impl UnsafeUnpin for ResetDepth
impl UnwindSafe for ResetDepth
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.