pub struct PosturePolicyPatch {
pub enter_events: Option<usize>,
pub enter_window_ms: Option<u64>,
pub duty_percent: Option<f64>,
pub duty_window_ms: Option<u64>,
pub exit_clean_ms: Option<u64>,
pub sim_intake_floor_override: Option<Option<usize>>,
}Expand description
A partial re-tune request over the six typed thresholds (JCI2FW Part B,
the operator channel’s wire shape): every field is None = “key not
supplied — keep the current value”. sim_intake_floor_override is
doubly-Option: the OUTER None is key-absent, and the inner
Some(None) is the operator supplying the key’s None value (clear the
override, back to half the slot cap — the typed key itself is
opt usize).
The semantic rules (windows > 0, duty percent in range, floors >= 1,
non-empty patch) are encoded ONCE, in Self::validate — callers
REJECT, never clamp silently.
Fields§
§enter_events: Option<usize>cordon_enter_events: the burst trigger count.
enter_window_ms: Option<u64>cordon_enter_window_ms: the burst window.
duty_percent: Option<f64>cordon_duty_percent: the duty trigger percent.
duty_window_ms: Option<u64>cordon_duty_window_ms: the duty window.
exit_clean_ms: Option<u64>cordon_exit_clean_ms: the exit hysteresis.
sim_intake_floor_override: Option<Option<usize>>cordon_sim_intake_floor: outer None = key absent; inner
Some(None) = clear the override; Some(Some(n)) = explicit floor.
Implementations§
Source§impl PosturePolicyPatch
impl PosturePolicyPatch
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether NO key was supplied (an empty patch — rejected by
Self::validate; a re-tune that changes nothing must never look
like a successful one).
Sourcepub fn validate(&self) -> Result<(), PostureRetuneError>
pub fn validate(&self) -> Result<(), PostureRetuneError>
The ONE encoding of the re-tune’s semantic rules. Every violation is
a typed PostureRetuneError naming the offending key and value —
the channel rejects, it never clamps.
§Errors
PostureRetuneError::EmptyPatch when no key was supplied, or the
per-key range error for the first offending value.
Trait Implementations§
Source§impl Clone for PosturePolicyPatch
impl Clone for PosturePolicyPatch
impl Copy for PosturePolicyPatch
Source§impl Debug for PosturePolicyPatch
impl Debug for PosturePolicyPatch
Source§impl Default for PosturePolicyPatch
impl Default for PosturePolicyPatch
Source§impl PartialEq for PosturePolicyPatch
impl PartialEq for PosturePolicyPatch
impl StructuralPartialEq for PosturePolicyPatch
Auto Trait Implementations§
impl Freeze for PosturePolicyPatch
impl RefUnwindSafe for PosturePolicyPatch
impl Send for PosturePolicyPatch
impl Sync for PosturePolicyPatch
impl Unpin for PosturePolicyPatch
impl UnsafeUnpin for PosturePolicyPatch
impl UnwindSafe for PosturePolicyPatch
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