unitscale/si.rs
1// Copyright 2025 GooseGrid Technologies
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! # SI prefixes
16//!
17//! Common SI prefixes as `UnitScale` for convenience.
18
19use crate::prelude::unit_scale;
20
21/// Prefix for `1E15`
22#[unit_scale(to = 1e15)]
23pub struct Peta;
24
25/// Prefix for `1E12`
26#[unit_scale(to = 1e12)]
27pub struct Tera;
28
29/// Prefix for `1E9`
30#[unit_scale(to = 1e9)]
31pub struct Giga;
32
33/// Prefix for `1E6`
34#[unit_scale(to = 1e6)]
35pub struct Mega;
36
37/// Prefix for `1E3`
38#[unit_scale(to = 1e3)]
39pub struct Kilo;
40
41/// Prefix for `1E2`
42#[unit_scale(to = 1e2)]
43pub struct Hecto;
44
45/// Prefix for `1E1`
46#[unit_scale(to = 1e1)]
47pub struct Deka;
48
49/// Prefix for `Base scale 1.0`
50#[unit_scale(to = 1e0)]
51pub struct Base;
52
53/// Prefix for `1E-1`
54#[unit_scale(to = 1e-1)]
55pub struct Deci;
56
57/// Prefix for `1E-2`
58#[unit_scale(to = 1e-2)]
59pub struct Centi;
60
61/// Prefix for `1E-3`
62#[unit_scale(to = 1e-3)]
63pub struct Milli;
64
65/// Prefix for `1E-6`
66#[unit_scale(to = 1e-6)]
67pub struct Micro;
68
69/// Prefix for `1E-9`
70#[unit_scale(to = 1e-9)]
71pub struct Nano;
72
73/// Prefix for `1E-12`
74#[unit_scale(to = 1e-12)]
75pub struct Pico;
76
77/// Prefix for `1E-15`
78#[unit_scale(to = 1e-15)]
79pub struct Femto;