macro_rules! tiny_fn { ($( $(#[$meta:meta])* $vis:vis struct $name:ident $(< $($t:ident),+ >)? = $fun:ident ($( $arg_name:ident: $arg_type:ty ),* $(,)?) $( -> $ret:ty)? $(| $(+ $markers:path)+)? ; )*) => { ... }; }
Expand description
Defines new structure type.
This type will be constructible from any closure
that implement specified Fn*
trait.
Closures that fits into inline storage will be placed there.
Otherwise closure will be boxed.
And it will have call
method with the same signature as the closure.
Defined type can have generic parameters that can be used in function signature.
It will always have additional const INLINE_SIZE: usize
generic parameter,
that controls size of the inline storage. Alignment of the inline storage is hardcoded to 16
which is enough for any primitive type and thus fits most of the types.