icao_units/
lib.rs

1// Copyright (c) 2024 Ken Barker
2
3// Permission is hereby granted, free of charge, to any person obtaining a copy
4// of this software and associated documentation files (the "Software"),
5// to deal in the Software without restriction, including without limitation the
6// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7// sell copies of the Software, and to permit persons to whom the Software is
8// furnished to do so, subject to the following conditions:
9
10// The above copyright notice and this permission notice shall be included in
11// all copies or substantial portions of the Software.
12
13// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19// THE SOFTWARE.
20
21//! [![crates.io](https://img.shields.io/crates/v/icao-units.svg)](https://crates.io/crates/icao-units)
22//! [![docs.io](https://docs.rs/icao-units/badge.svg)](https://docs.rs/icao-units/)
23//! [![License](https://img.shields.io/badge/License-MIT-blue)](https://opensource.org/license/mit/)
24//! [![Rust](https://github.com/kenba/icao-units-rs/actions/workflows/rust.yml/badge.svg)](https://github.com/kenba/icao-units-rs/actions)
25//! [![codecov](https://codecov.io/gh/kenba/icao-units-rs/graph/badge.svg?token=6DTOY9Y4BT)](https://codecov.io/gh/kenba/icao-units-rs)
26//!
27//! Units for air navigation as defined in [International Civil Aviation Organization](https://icao.int/) (ICAO)
28//! [Annex 5](https://store.icao.int/en/annex-5-units-of-measurement-to-be-used-in-the-air-and-ground-services).
29//!
30//! The library defines:
31//!
32//! - the [SI](https://en.wikipedia.org/wiki/International_System_of_Units)
33//!   units used in the [International Standard Atmosphere](https://en.wikipedia.org/wiki/International_Standard_Atmosphere) (ISA),
34//! - the non-SI units defined in `ICAO Annex 5` Table 3-3,
35//! - and conversions between SI and non-SI units.
36//!
37//! The library uses the [newtype](https://rust-unofficial.github.io/patterns/patterns/behavioural/newtype.html)
38//! idiom to represent ICAO units and the [From](https://doc.rust-lang.org/core/convert/trait.From.html)
39//! trait to convert between SI and non-SI units using the conversion factors
40//! defined in `ICAO Annex 5` Table 3-3.
41//!
42//! The library is declared [no_std](https://docs.rust-embedded.org/book/intro/no-std.html)
43//! so it can be used in embedded applications.
44
45#![cfg_attr(not(test), no_std)]
46
47pub mod non_si;
48pub mod si;