Skip to content

WaffleLapkin/typed_phy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

80 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

typed_phy

(TODO: maybe I should rename the lib?)

CI status Telegram documentation (master) LICENSE

This is a lib for working with typed physical quantities. It ensures at compile time that you couldn't add meters to seconds or do other weird stuff.

use typed_phy::IntExt;

let length = 20.m() + 4.m();
let time = 2.s() * 3;

let speed = length / time;

assert_eq!(speed, 4.mps());

the crate isn't published on crates.io yet, so to use it spicify it as a git dependency:

[dependencies]
# Replace <...> with commit you want to use (it is recomended to use the latest commit)
typed_phy = { git = "https://github.com/WaffleLapkin/typed_phy", rev = "<...>" }

Warning

WIP

Releases

No releases published

Packages

No packages published

Languages