Skip to main content

Module serde_defaults

Module serde_defaults 

Source
Expand description

Workspace-canonical serde-default owners — the ONE substrate site every #[serde(default = "…")] slot on a plain scalar constant (true, false, 0u32, …) reaches for its serde-default fn.

Pre-lift each shape lived as a per-file fn default_<X>() -> <T> { <constant> } private shim; because serde’s default = "path" contract dispatches on a NAMED function rather than an inline literal, every consumer file grew its own local shim body — and the FIVE consumer files that all needed the -> bool { true } shape each spelled the SAME three-line body byte-identically. Post-lift every consumer routes through the ONE substrate owner here so a future normalization (a debug-build assertion, a per-fleet override injected via env var, a rename that folds default_true into a serde_defaults::TRUE typed handle) lands at THIS module and every downstream serde-default consumer inherits the upgrade mechanically.

Peer to crate::lifetime::default_ephemeral_ttl + crate::lifetime::default_ephemeral_max_concurrent on the “workspace-canonical serde-default owners” axis. Where those two primitives own the ephemeral-authoring-surface-specific defaults ("1h" / 1u32), this module owns the plain-scalar-constant defaults that no CRD-specific axis binds to a single crate — the -> bool { true } shape recurs anywhere a boolean field’s serde default is “on” for backward-compat, safe-default, or feature-flag reasons, and each variant of that shape wants ONE substrate owner rather than a private per-file shim.

Constants§

DEFAULT_SIGTERM_GRACE_SECONDS
Workspace-canonical u32 handle over the same 480 value default_sigterm_grace_seconds returns. Use this const for compile-time comparisons and const-context readers; use default_sigterm_grace_seconds for the serde default = "…" slot contract.
DEFAULT_TRUE
Workspace-canonical bool handle over the same true value default_true returns. Use this const for compile-time comparisons and const-context readers; use default_true for the serde default = "…" slot contract.
DEFAULT_ZOMBIE_TIMEOUT_SECONDS
Workspace-canonical u32 handle over the same 600 value default_zombie_timeout_seconds returns. Use this const for compile-time comparisons and const-context readers; use default_zombie_timeout_seconds for the serde default = "…" slot contract.

Functions§

default_sigterm_grace_seconds
Workspace-canonical -> u32 { 480 } SIGTERM→SIGKILL grace-window serde-default owner — the ONE substrate site every #[serde(default = "…")] slot on a u32 field whose semantic is “seconds to wait after delivering SIGTERM before escalating to SIGKILL” routes through.
default_true
Workspace-canonical -> bool { true } serde-default owner — the ONE substrate site every #[serde(default = "…")] slot on a bool field whose “on by default” invariant matches the pre-lift shape routes through.
default_zombie_timeout_seconds
Workspace-canonical -> u32 { 600 } Zombie-phase force-reap timeout serde-default owner — the ONE substrate site every #[serde(default = "…")] slot on a u32 field whose semantic is “seconds a Process is permitted to sit in Zombie before PID 1 force-reaps it” routes through, PLUS the ONE substrate anchor every hand-authored ProcessTableSpec composer that pre-populates the zombie_timeout_seconds slot with the workspace-canonical wire-form routes through.