pub enum OpticError {
NonFinite {
field: &'static str,
},
NegativeLimit {
field: &'static str,
value: f64,
},
NonPositiveClickSize {
field: &'static str,
size: f64,
},
ZeroClicksPerRevolution,
StateOutsideTravel {
axis: &'static str,
dialed_mil: f64,
down_mil: f64,
up_mil: f64,
},
NonPositiveTrackingFactor {
field: &'static str,
value: f64,
},
}Expand description
Why an OpticProfile failed validate.
Variants§
NonFinite
A field that must be finite was NaN or infinite.
NegativeLimit
A travel or hold-bound magnitude was negative.
NonPositiveClickSize
A click graduation’s size was zero or negative. ClickValue’s fields are pub,
so this is reachable by direct construction even though parse_click_value
(crate::adjustment) already excludes it on every string-parsed or deserialized
click — see that function and ClickValue’s Deserialize impl.
ZeroClicksPerRevolution
clicks_per_revolution was Some(0). Zero clicks is not a revolution.
StateOutsideTravel
turret_state’s value on axis fell outside that axis’s declared
TravelLimits (both measured from the same zero).
NonPositiveTrackingFactor
A tracking correction factor (elevation_cf/windage_cf in plan_corrections)
was zero, negative, or non-finite (MBA-1348 review fix). plan_corrections divides
a TRUE angular correction by the CF to get a DIAL target (see the module’s “CF
rule” doc section); a zero or negative CF turns that into infinity, NaN, or a
direction-inverting garbage value that would silently propagate into a “plan” that
looks like ordinary output. Rejected outright rather than merely warned about –
crate::adjustment::tracking_cf_in_range’s tighter (0.5, 1.5) plausibility band
is deliberately NOT re-enforced here, matching this crate’s existing precedent
(crate::truing::scale_report_dial_values also takes a bare, unchecked dial_cf)
of treating that band as an advisory, caller/CLI-level concern, not a hard
library-level bound – unlike card::AdaptiveRequest’s hard enforcement of the same
band (see its own doc comment): the planner does not enforce it here because
plan_corrections’s residual stays honest under a wild CF, while the card engine
does enforce it because a large finite CF there would otherwise produce a confident
budget_met: true on a card that does not actually meet its stated error budget.
Trait Implementations§
Source§impl Clone for OpticError
impl Clone for OpticError
Source§fn clone(&self) -> OpticError
fn clone(&self) -> OpticError
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 OpticError
impl Debug for OpticError
Source§impl Display for OpticError
impl Display for OpticError
Source§impl Error for OpticError
impl Error for OpticError
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 OpticError
impl PartialEq for OpticError
impl StructuralPartialEq for OpticError
Auto Trait Implementations§
impl Freeze for OpticError
impl RefUnwindSafe for OpticError
impl Send for OpticError
impl Sync for OpticError
impl Unpin for OpticError
impl UnsafeUnpin for OpticError
impl UnwindSafe for OpticError
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> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.