pub struct ClickValue {
pub size: f64,
pub base: ClickBase,
}Expand description
A turret click graduation, parsed from suffixed CLI/profile syntax like “0.1mil” / “0.25moa” / “0.125smoa” (MBA-1355).
Fields§
§size: f64§base: ClickBaseTrait Implementations§
Source§impl Clone for ClickValue
impl Clone for ClickValue
Source§fn clone(&self) -> ClickValue
fn clone(&self) -> ClickValue
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ClickValue
Source§impl Debug for ClickValue
impl Debug for ClickValue
Source§impl<'de> Deserialize<'de> for ClickValue
Deserializes via parse_click_value — the ONLY parser for this syntax, not a second,
divergent implementation of it — so a malformed string is rejected with the identical
message the CLI already gives, and parse_click_value’s positive-and-finite rule
applies on every deserialize (MBA-1348).
impl<'de> Deserialize<'de> for ClickValue
Deserializes via parse_click_value — the ONLY parser for this syntax, not a second,
divergent implementation of it — so a malformed string is rejected with the identical
message the CLI already gives, and parse_click_value’s positive-and-finite rule
applies on every deserialize (MBA-1348).
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 ClickValue
impl PartialEq for ClickValue
Source§impl Serialize for ClickValue
Serializes as the crate’s one existing suffixed-string representation — "0.1mil",
"0.25moa", "1smoa" — the exact shape parse_click_value parses and a CLI
--elevation-click flag already accepts (MBA-1348). Deliberately NOT the structural
{"size": 0.1, "base": "mil"} a plain derive would produce: the string form is stable
against internal field changes and makes a profile file’s click entries identical to
the CLI flag syntax a shooter already types. size uses f64’s default Display,
which is Rust’s shortest string that round-trips back to the same value (so 1.0
prints as "1", matching parse_click_value’s own accepted syntax).
impl Serialize for ClickValue
Serializes as the crate’s one existing suffixed-string representation — "0.1mil",
"0.25moa", "1smoa" — the exact shape parse_click_value parses and a CLI
--elevation-click flag already accepts (MBA-1348). Deliberately NOT the structural
{"size": 0.1, "base": "mil"} a plain derive would produce: the string form is stable
against internal field changes and makes a profile file’s click entries identical to
the CLI flag syntax a shooter already types. size uses f64’s default Display,
which is Rust’s shortest string that round-trips back to the same value (so 1.0
prints as "1", matching parse_click_value’s own accepted syntax).
impl StructuralPartialEq for ClickValue
Auto Trait Implementations§
impl Freeze for ClickValue
impl RefUnwindSafe for ClickValue
impl Send for ClickValue
impl Sync for ClickValue
impl Unpin for ClickValue
impl UnsafeUnpin for ClickValue
impl UnwindSafe for ClickValue
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.