5 unstable releases

0.7.0 Jan 7, 2024
0.6.2 Oct 31, 2021
0.6.0 Apr 6, 2021
0.5.1 Aug 30, 2020
0.5.0 Jul 18, 2020

#398 in Date and time

Download history 104/week @ 2023-12-18 70/week @ 2023-12-25 126/week @ 2024-01-01 164/week @ 2024-01-08 120/week @ 2024-01-15 156/week @ 2024-01-22 128/week @ 2024-01-29 115/week @ 2024-02-05 332/week @ 2024-02-12 459/week @ 2024-02-19 508/week @ 2024-02-26 660/week @ 2024-03-04 579/week @ 2024-03-11 649/week @ 2024-03-18 670/week @ 2024-03-25 765/week @ 2024-04-01

2,792 downloads per month
Used in 6 crates (4 directly)

MPL-2.0 license

325KB
8K 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.4–3.5MB
~65K SLoC