simple-si-units-core

This crate exists to support the simple-si-units. Please go there for more information.

Contents

Crate simple-si-units-core exports the following:

UnitData

This is an ergonomic trait bundle that combines the following: * std::ops::Add * std::ops::Sub * std::ops::Mul * std::ops::Div * Sized

Thus you can use this trait as part of a struct or function template definition, like this:

```rust use simplesiunits_core::UnitData; pub struct MyUnit { v: DT, }

impl std::ops::Add for MyUnit

{ type Output = Self; fn add(self, rhs: Self) -> Self::Output { return Self { v: self.v + rhs.v }; } }

impl std::ops::Sub for MyUnit

{ type Output = Self; fn sub(self, rhs: Self) -> Self::Output { return Self { v: self.v - rhs.v }; } } ```

License

This library is open source, licensed under the Mozilla Public License version 2.0. In summary, you may include this source code as-is in both open-source and proprietary projects without requesting permission from me, but if you modify the source code from this library then you must make your modified version of this library available under an open-source license.