6 releases (3 breaking)
0.8.0 | Apr 21, 2024 |
---|---|
0.7.0 | Jan 7, 2024 |
0.6.2 | Oct 31, 2021 |
0.6.0 | Apr 6, 2021 |
0.5.0 | Jul 18, 2020 |
#363 in Date and time
3,599 downloads per month
Used in 6 crates
(4 directly)
355KB
9K
SLoC
Rink Core
Rink Core is the library that implements most of the special language and calculations in Rink. It's mainly intended to be used in projects that are exposing an end user interface to Rink, e.g. a discord bot or a mobile app.
lib.rs
:
The primary interface of this library is meant to expose a very simple command-reply model for frontends, and to allow gradual addition of more advanced functionality. For now, only basic functionality exists.
Using Rink as a library for uses other than simple unit conversion tools is not currently well supported, and if you wish to do so, please make issues for any problems you have.
There are currently a number of hardcoded println!
s and unwrap()
s
because most of this code was written in a day without much thought
towards making it into a library.
To use the library, check how the CLI tool does it. To get additional features like currency and BTC you'll need to fetch those files yourself and add them into the Context.
Example
use rink_core::*;
let mut ctx = simple_context().unwrap();
println!("{}", one_line(&mut ctx, "kWh / year -> W").unwrap());
Dependencies
~2.9–4.5MB
~74K SLoC