Skip to main content

CardRequestV1

Struct CardRequestV1 

Source
pub struct CardRequestV1 {
Show 33 fields pub units: CardUnits, pub muzzle_velocity: f64, pub ballistic_coefficient: f64, pub mass: f64, pub diameter: f64, pub drag_model: DragModelV1, pub sight_height: f64, pub zero_distance: f64, pub zero_poi_vertical: f64, pub zero_poi_horizontal: f64, pub sight_offset_lateral: f64, pub temperature: Option<f64>, pub pressure: Option<f64>, pub humidity: f64, pub altitude: f64, pub wind_speed: f64, pub wind_direction_deg: f64, pub start: f64, pub end: f64, pub step: f64, pub adjustment_unit: AdjustmentUnit, pub windage_unit: Option<AdjustmentUnit>, pub elevation_click_value: Option<String>, pub windage_click_value: Option<String>, pub elevation_cf: f64, pub windage_cf: f64, pub zero_set_elevation_bias_mil: f64, pub zero_set_windage_bias_mil: f64, pub wind_speeds: Vec<f64>, pub wind_angles_deg: Vec<f64>, pub bc_segments: Option<Vec<CardBcSegmentV1>>, pub bc5d_table_path: Option<String>, pub pdf: Option<PdfCardOptionsV1>,
}
Expand description

Everything the three card surfaces share: load, zero, atmosphere, display axes. Field values are in the units system (see module docs).

Fields§

§units: CardUnits§muzzle_velocity: f64§ballistic_coefficient: f64§mass: f64

grains (imperial) / grams (metric)

§diameter: f64

inches (imperial) / mm (metric)

§drag_model: DragModelV1§sight_height: f64

inches (imperial) / mm (metric); CLI default 1.5 in

§zero_distance: f64§zero_poi_vertical: f64

Deliberate POI offset at the zero range, in the units system’s LINEAR drop unit (inches / mm); 0 = zeroed dead-on.

§zero_poi_horizontal: f64§sight_offset_lateral: f64

Lateral sight-to-bore mount offset (inches / mm).

§temperature: Option<f64>§pressure: Option<f64>§humidity: f64§altitude: f64§wind_speed: f64§wind_direction_deg: f64§start: f64§end: f64§step: f64§adjustment_unit: AdjustmentUnit§windage_unit: Option<AdjustmentUnit>

Windage axis unit; defaults to the elevation axis.

§elevation_click_value: Option<String>

Turret graduations as suffixed strings (“0.1mil”, “0.25moa”); required when the corresponding axis unit is clicks. Windage falls back to elevation.

§windage_click_value: Option<String>§elevation_cf: f64

Scope tracking correction factors (MBA-1358); 1.0 = tracks true.

§windage_cf: f64§zero_set_elevation_bias_mil: f64

Selected zero set’s dial corrections, true angular MIL (MBA-1360).

§zero_set_windage_bias_mil: f64§wind_speeds: Vec<f64>

Wind card only: the sweep of wind speeds (mph / m/s), one output column each.

§wind_angles_deg: Vec<f64>

Wind card only: wind-FROM angles in degrees; default [90] (full-value from the right), matching the CLI.

§bc_segments: Option<Vec<CardBcSegmentV1>>

Explicit velocity-banded BC schedule, mirroring the CLI’s repeatable --bc-segment VMIN:VMAX:BC. Velocities are in the request’s units velocity unit (fps imperial / m/s metric), exactly like the CLI flag. When supplied it wins over bc5d_table_path, and — CLI parity — the scalar ballistic_coefficient remains the interior-gap fallback unchanged. The schedule feeds BOTH the zero solve and every sampled trajectory.

§bc5d_table_path: Option<String>

Filesystem path to a caliber-specific BC5D correction table (bc5d_<caliber>.bin, the exact format the CLI’s --bc-table-dir consumes). The table is CRC-verified, a velocity-keyed BC schedule is generated for this load (same ladder as the CLI), and the scalar BC gets the table’s muzzle correction as the interior-gap fallback. Ignored when bc_segments is supplied. Not available on wasm32 builds (no filesystem); there it is rejected with an invalid-request error.

§pdf: Option<PdfCardOptionsV1>

Presentation-only options for the printable PDF dope card (card.pdf). Nothing in here touches the ballistics: the numbers in the PDF are the rows range_table_v1 returns, computed by the same call.

It lives on the shared request — rather than in a card.pdf-only wrapper type — so an app stores ONE CardRequestV1 per saved card and replays that exact document against either surface: card.range_table for the screen, card.pdf for the printout. The on-screen commands ignore this block.

Deliberately NOT #[cfg(feature = "pdf")], even though everything that consumes it is: CardRequestV1 denies unknown fields, so gating the field would make a pdf-less build REJECT a stored request that carries it, breaking exactly the round-trip the field exists to support. A pdf-less build parses it and never reads it; only the card.pdf command itself disappears.

Trait Implementations§

Source§

impl Clone for CardRequestV1

Source§

fn clone(&self) -> CardRequestV1

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CardRequestV1

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for CardRequestV1

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.