pub struct PosturePolicy {
pub enter_events: usize,
pub enter_window_ms: u64,
pub duty_percent: f64,
pub duty_window_ms: u64,
pub exit_clean_ms: u64,
pub sim_intake_floor_override: Option<usize>,
}Expand description
Typed thresholds (Q5 amendment) — PosturePolicy::from_config is the
boot source; the operator channel re-derives from the same schema keys.
Fields§
§enter_events: usizeEnter trigger (a): >= this many throttle events in the enter window.
enter_window_ms: u64Enter window (a): the rolling burst window.
duty_percent: f64Enter trigger (b): throttled-time duty percent over the duty window
(2.0 = >2%).
duty_window_ms: u64Enter trigger (b) window.
exit_clean_ms: u64Exit: this much continuous clean time required after the last dirty sample (hysteresis prevents flapping; §6: 10 s).
sim_intake_floor_override: Option<usize>Cordon effect (b): sim intake cap while cordoned; None = half the
slot cap (in-flight sims are never cancelled).
Implementations§
Source§impl PosturePolicy
impl PosturePolicy
Sourcepub const fn doc_defaults() -> Self
pub const fn doc_defaults() -> Self
The design-doc §6 defaults (2 events / 1 s, >2% / 5 s, 10 s clean), used when a host boots without a typed config (hermetic runs).
Sourcepub fn from_config(cfg: &FleetConfig) -> Self
pub fn from_config(cfg: &FleetConfig) -> Self
The typed-config projection — every threshold is a schema key.
Sourcepub fn sim_intake_cap(&self, slot_cap: usize) -> usize
pub fn sim_intake_cap(&self, slot_cap: usize) -> usize
The cordon sim-intake cap: override or half the slot cap, floored at 1, never above the cap (§6 effect (b)).
Sourcepub fn patched_with(self, patch: PosturePolicyPatch) -> Self
pub fn patched_with(self, patch: PosturePolicyPatch) -> Self
Apply a validated PosturePolicyPatch to self, producing the
effective policy (the JCI2FW Part B re-tune channel’s only write
path: current policy + supplied fields). Pure — the caller feeds the
result to PostureOwner::retune. Call PosturePolicyPatch::validate
FIRST; this projection never checks semantics.
Trait Implementations§
Source§impl Clone for PosturePolicy
impl Clone for PosturePolicy
impl Copy for PosturePolicy
Source§impl Debug for PosturePolicy
impl Debug for PosturePolicy
Source§impl PartialEq for PosturePolicy
impl PartialEq for PosturePolicy
impl StructuralPartialEq for PosturePolicy
Auto Trait Implementations§
impl Freeze for PosturePolicy
impl RefUnwindSafe for PosturePolicy
impl Send for PosturePolicy
impl Sync for PosturePolicy
impl Unpin for PosturePolicy
impl UnsafeUnpin for PosturePolicy
impl UnwindSafe for PosturePolicy
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more