Lib Runner
Rust package to assist runners in planning workouts, completing races, and improving health.
Usage
Let's go through these quick steps to get started with LibRunner:
-
visit https://rustup.rs and install rustup, an installer for the programming language Rust. Once installed, update and check the toolchain:
$ rustup update $ rustc --version $ cargo --version -
create your new running application:
$ cargo new runningapp -
a folder called
runningappis created. Go into it and run the project:$ cd runningapp $ cargo run -
it prints "Hello World", meaning you have a working code to start from. Open the project in your favorite code editor and make two changes:
4.1. add LibRunner to the project's dependencies:
$ cargo add librunnerIt adds a new dependency to your
Cargo.tomlfile:[] = "0.6.0"4.2. replace the content of the file
src/main.rswith the code below:use Duration; use Race; use Running; use MetricRace; use ImperialRace; use MetricRunning; use ImperialRunning; use converter; use formatter; -
then run the project again:
$ cargo runwhich generates the following output:
The pace to run 42.195km in 04:00:00h is approximately 05:41/km at 10.55km/h The pace to run 26.2 miles in 04:00:00h is approximately 09:09/mile at 6.55mph
License
LibRunner is used under the terms of the Apache License version 2.0.