[−][src]Crate rink
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.
For basic flow of the library, the bins/
directory has a few
examples. The REPL is very simple, and the IRC bot shows how Rink can
work in a multi-user environment without sessions or meaningful
stdin/stdout.
Example
use rink::*; let mut ctx = load().unwrap(); println!("{}", one_line(&mut ctx, "kWh / year -> W").unwrap());
Re-exports
pub use number::Number; |
pub use context::Context; |
pub use value::Value; |
Modules
ast | |
btc | |
context | |
currency | |
date | |
eval | |
factorize | |
formula | |
gnu_units | |
load | |
num | |
number | |
reply | |
search | |
substance | |
text_query | |
value |
Functions
config_dir | |
load | Creates a context by searching standard directories for definitions.units. |
one_line | Evaluates a single line within a context. |