Struct dive_deco::BuehlmannConfig
source · pub struct BuehlmannConfig {
pub gf: GradientFactors,
pub surface_pressure: u16,
}
Fields§
§gf: GradientFactors
§surface_pressure: u16
Implementations§
source§impl BuehlmannConfig
impl BuehlmannConfig
sourcepub fn new() -> Self
pub fn new() -> Self
Examples found in repository?
examples/config_example.rs (line 19)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
fn main() {
// model with default config (GF 100/100)
let default_config = BuehlmannConfig::default();
let model_1 = BuehlmannModel::new(default_config);
println!("{:?}", model_1.config()); // BuehlmannConfig { gf: (100, 100) }
// model with config instance
let config_instance = BuehlmannConfig {
gf: (85, 85),
surface_pressure: 1013,
};
let model_2 = BuehlmannModel::new(config_instance);
println!("{:?}", model_2.config());
// model with fluent-interface-like config
let config_with_gf = BuehlmannConfig::new().gradient_factors(30, 70);
let model_3 = BuehlmannModel::new(config_with_gf);
println!("{:?}", model_3.config()); // BuehlmannConfig { gf: (30, 70) }
}
sourcepub fn gradient_factors(self, gf_low: u8, gf_high: u8) -> Self
pub fn gradient_factors(self, gf_low: u8, gf_high: u8) -> Self
Examples found in repository?
examples/config_example.rs (line 19)
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
fn main() {
// model with default config (GF 100/100)
let default_config = BuehlmannConfig::default();
let model_1 = BuehlmannModel::new(default_config);
println!("{:?}", model_1.config()); // BuehlmannConfig { gf: (100, 100) }
// model with config instance
let config_instance = BuehlmannConfig {
gf: (85, 85),
surface_pressure: 1013,
};
let model_2 = BuehlmannModel::new(config_instance);
println!("{:?}", model_2.config());
// model with fluent-interface-like config
let config_with_gf = BuehlmannConfig::new().gradient_factors(30, 70);
let model_3 = BuehlmannModel::new(config_with_gf);
println!("{:?}", model_3.config()); // BuehlmannConfig { gf: (30, 70) }
}
pub fn surface_pressure(self, surface_pressure: u16) -> Self
Trait Implementations§
source§impl Clone for BuehlmannConfig
impl Clone for BuehlmannConfig
source§fn clone(&self) -> BuehlmannConfig
fn clone(&self) -> BuehlmannConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for BuehlmannConfig
impl Debug for BuehlmannConfig
source§impl Default for BuehlmannConfig
impl Default for BuehlmannConfig
source§impl PartialEq for BuehlmannConfig
impl PartialEq for BuehlmannConfig
source§fn eq(&self, other: &BuehlmannConfig) -> bool
fn eq(&self, other: &BuehlmannConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Copy for BuehlmannConfig
impl StructuralPartialEq for BuehlmannConfig
Auto Trait Implementations§
impl Freeze for BuehlmannConfig
impl RefUnwindSafe for BuehlmannConfig
impl Send for BuehlmannConfig
impl Sync for BuehlmannConfig
impl Unpin for BuehlmannConfig
impl UnwindSafe for BuehlmannConfig
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