Module example

Source
Expand description

This module contains a few example declarations with tiny_fn! macro.
And their usage in the section below.

§Usage

let binop: BinOp::<i32, 24> = BinOp::new(|a, b| a + b);
assert_eq!(3, binop.call(1, 2));

let a = "Hello".to_owned();
let b = "world".to_owned();
let make_string = MakeString::<32>::new(move || format!("{a} {b}!"));

assert_eq!(make_string.call(), "Hello world!");

Structs§

BinOp
Contains any binary operation for a specific type. That takes two values of that type and returns value of that type.
MakeString