[][src]Struct capra_core::common::gas::Gas

pub struct Gas { /* fields omitted */ }

A gas mix used in a dive.

Implementations

impl Gas[src]

pub fn new(o2: usize, he: usize, n2: usize) -> Result<Self, GasError>[src]

Returns a new Gas with the given parameters.

Arguments

  • o2 - Percentage fraction of oxygen in the mix.
  • he - Percentage fraction of helium in the mix.
  • n2 - Percentage fraction of nitrogen in the mix.

Errors

This function will return a GasError if the percentage fractions do not add up to 100.

pub fn fr_n2(&self) -> f64[src]

Returns the fraction of nitrogen in the mix.

pub fn fr_o2(&self) -> f64[src]

Returns the fraction of oxygen in the mix.

pub fn fr_he(&self) -> f64[src]

Returns the fraction of helium in the mix.

pub fn o2(&self) -> usize[src]

Returns the percentage fraction of oxygen in the mix.

pub fn he(&self) -> usize[src]

Returns the percentage fraction of helium in the mix.

pub fn n2(&self) -> usize[src]

Returns the percentage fraction of nitrogen in the mix.

pub fn equivalent_narcotic_depth(&self, depth: usize) -> usize[src]

Returns the Equivalent Narcotic Depth (END) of the mix at a given depth.

Arguments

  • depth - The depth the mix is being breathed at.

pub fn in_ppo2_range(&self, depth: usize, min: f64, max: f64) -> bool[src]

Helper function to check whether the mix is in an acceptable ppO2 range at a given depth.

Arguments

  • depth -Depth the mix is being breathed at.
  • min - Minimum tolerable ppO2.
  • max - Maximum tolerable ppO2.

pub fn pp_o2(&self, depth: usize, metres_per_bar: f64) -> f64[src]

Returns the ppO2 of the mix at a given depth.

Arguments

  • depth - Depth the mix is being breathed at.
  • metres_per_bar - Depth of water required to induce 1 bar of pressure.

pub fn pp_he(&self, depth: usize, metres_per_bar: f64) -> f64[src]

Returns the ppHe of the mix at a given depth.

Arguments

  • depth - Depth the mix is being breathed at.
  • metres_per_bar - Depth of water required to induce 1 bar of pressure.

pub fn pp_n2(&self, depth: usize, metre_per_bar: f64) -> f64[src]

Returns the ppN2 of the mix at a given depth.

Arguments

  • depth - Depth the mix is being breathed at.
  • metres_per_bar - Depth of water required to induce 1 bar of pressure.

Trait Implementations

impl Clone for Gas[src]

impl Copy for Gas[src]

impl Debug for Gas[src]

impl Eq for Gas[src]

impl Hash for Gas[src]

impl PartialEq<Gas> for Gas[src]

impl StructuralEq for Gas[src]

impl StructuralPartialEq for Gas[src]

Auto Trait Implementations

impl RefUnwindSafe for Gas

impl Send for Gas

impl Sync for Gas

impl Unpin for Gas

impl UnwindSafe for Gas

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.