pub struct OpticProfile {
pub elevation_click: ClickValue,
pub windage_click: ClickValue,
pub clicks_per_revolution: Option<u32>,
pub zero_stop: bool,
pub elevation_travel: Option<TravelLimits>,
pub windage_travel: Option<TravelLimits>,
pub turret_state: Option<TurretState>,
pub reticle_hold_bounds: Option<HoldBounds>,
}Expand description
A shooter’s complete turret and reticle geometry (MBA-1348).
Every angular field anywhere in this type is in MIL. Turret-related fields
(clicks_per_revolution, elevation_travel, windage_travel, turret_state) are in
DIAL-space; reticle_hold_bounds is TRUE angular. See the module docs for what that
distinction means and why it matters.
Fields§
§elevation_click: ClickValueElevation turret’s click graduation (its engraved size, e.g. 0.1 mil or 1/4 MOA).
Serializes as crate::adjustment::ClickValue’s own suffixed string ("0.1mil"),
not a structural object. validate requires a positive size.
windage_click: ClickValueWindage turret’s click graduation. Same serialized form and validate rule as
elevation_click.
clicks_per_revolution: Option<u32>Click detents per full turret revolution, for turrets whose cap marks revolutions
at all (many hunting turrets do not, hence Option). Must be at least 1 when
present — Some(0) is rejected by validate, since a revolution with zero clicks
in it is not a revolution.
zero_stop: boolWhether the elevation turret hard-stops at elevation_travel.down_mil, so the
shooter cannot dial below zero at all. Descriptive metadata about the mechanism:
validate does not require elevation_travel to be Some just because
zero_stop is true, or vice versa.
elevation_travel: Option<TravelLimits>Elevation travel remaining in each direction from the current zero setting (not from the mechanical bottom of the turret) — DIAL-space, mil.
windage_travel: Option<TravelLimits>Windage travel from the current zero — DIAL-space, mil. down_mil is LEFT travel,
up_mil is RIGHT travel (see TravelLimits).
turret_state: Option<TurretState>The turret’s current dialed offset from zero — DIAL-space, mil.
reticle_hold_bounds: Option<HoldBounds>The reticle’s usable hold extent — TRUE angular, mil. See HoldBounds: this is an
EXPLICIT input and is never derived from a crate::reticle::ReticleDescription.
Implementations§
Source§impl OpticProfile
impl OpticProfile
Sourcepub fn validate(&self) -> Result<(), OpticError>
pub fn validate(&self) -> Result<(), OpticError>
Checks internal consistency: every angular field is finite, both click sizes are
positive, every travel/hold-bound magnitude is non-negative, clicks_per_revolution
is a sane count, and — when both are present — turret_state lies within
elevation_travel / windage_travel.
This cannot and does not check that the profile matches any real, physical scope;
it only rejects shapes that are self-contradictory or would corrupt downstream
arithmetic (a zero-length revolution, NaN propagation, a dialed state the turret
could not physically reach given its own declared travel, or a zero/negative click
size that would turn a later quantize_angle division into infinity or NaN).
Trait Implementations§
Source§impl Clone for OpticProfile
impl Clone for OpticProfile
Source§fn clone(&self) -> OpticProfile
fn clone(&self) -> OpticProfile
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 OpticProfile
impl Debug for OpticProfile
Source§impl<'de> Deserialize<'de> for OpticProfile
impl<'de> Deserialize<'de> for OpticProfile
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>,
Source§impl PartialEq for OpticProfile
impl PartialEq for OpticProfile
Source§impl Serialize for OpticProfile
impl Serialize for OpticProfile
impl StructuralPartialEq for OpticProfile
Auto Trait Implementations§
impl Freeze for OpticProfile
impl RefUnwindSafe for OpticProfile
impl Send for OpticProfile
impl Sync for OpticProfile
impl Unpin for OpticProfile
impl UnsafeUnpin for OpticProfile
impl UnwindSafe for OpticProfile
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>,
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.