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

#378 in Date and time

Download history 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 739/week @ 2024-04-01 649/week @ 2024-04-08 917/week @ 2024-04-15 605/week @ 2024-04-22

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

MPL-2.0 license

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

~3–4.5MB
~75K SLoC