maller 0.1.0

a rust library crate that calls closures depending on the input data
Documentation
  • Coverage
  • 100%
    14 out of 14 items documented6 out of 10 items with examples
  • Size
  • Source code size: 21.24 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.31 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Gor-Madatyan/maller
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Gor-Madatyan

This is a small Rust library that provides a Maller structure, which allows you to call closures by key.

Documentation

Usage`

Add this to your Cargo.toml file:

[dependencies]
maller = "0.1"

or use

cargo add maller

Then, you can use the Maller and Input structures in your Rust code The input and new_input functions from utils allow you to create an input closure. More details in the documentation.

Example

use maller::{input, Maller};

fn main() {
    let mut con=0;

    let c1=|x|{con+=1;2};
    let c2=|x|3;

    let mut maller=Maller::from_iter(
        [(898, input(c1)),
         (500, input(c2))]
    );

    assert_eq!(maller.call(&898).unwrap(),2);
}

License

This code is licensed under the "Apache-2.0 OR Unlicense" License.