pub struct Bc5dTableManager { /* private fields */ }Expand description
Manager for loading caliber-specific BC5D tables
Implementations§
Source§impl Bc5dTableManager
impl Bc5dTableManager
Sourcepub fn new<P: AsRef<Path>>(table_dir: P) -> Self
pub fn new<P: AsRef<Path>>(table_dir: P) -> Self
Create a new table manager with a directory path
Sourcepub fn get_table(&mut self, caliber: f64) -> Result<&Bc5dTable, Bc5dError>
pub fn get_table(&mut self, caliber: f64) -> Result<&Bc5dTable, Bc5dError>
Get or load the table for a caliber
Tables are cached after first load.
Sourcepub fn lookup(
&mut self,
caliber: f64,
weight_grains: f64,
base_bc: f64,
muzzle_velocity: f64,
current_velocity: f64,
drag_type: &str,
) -> Result<f64, Bc5dError>
pub fn lookup( &mut self, caliber: f64, weight_grains: f64, base_bc: f64, muzzle_velocity: f64, current_velocity: f64, drag_type: &str, ) -> Result<f64, Bc5dError>
Look up BC correction for a bullet
Sourcepub fn get_effective_bc(
&mut self,
caliber: f64,
weight_grains: f64,
base_bc: f64,
muzzle_velocity: f64,
current_velocity: f64,
drag_type: &str,
) -> Result<f64, Bc5dError>
pub fn get_effective_bc( &mut self, caliber: f64, weight_grains: f64, base_bc: f64, muzzle_velocity: f64, current_velocity: f64, drag_type: &str, ) -> Result<f64, Bc5dError>
Get effective BC with correction applied
Sourcepub fn available_calibers(&self) -> Vec<f64>
pub fn available_calibers(&self) -> Vec<f64>
List available calibers in the table directory
Trait Implementations§
Source§impl Debug for Bc5dTableManager
impl Debug for Bc5dTableManager
Source§impl Default for Bc5dTableManager
impl Default for Bc5dTableManager
Source§fn default() -> Bc5dTableManager
fn default() -> Bc5dTableManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for Bc5dTableManager
impl RefUnwindSafe for Bc5dTableManager
impl Send for Bc5dTableManager
impl Sync for Bc5dTableManager
impl Unpin for Bc5dTableManager
impl UnwindSafe for Bc5dTableManager
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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
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
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
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.