einmalig 1.0.0

A tiny crate that allows unsizing `FnOnce` functions without boxing.
Documentation
  • Coverage
  • 25%
    1 out of 4 items documented1 out of 3 items with examples
  • Size
  • Source code size: 16.4 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 165.6 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • mattfbacon/einmalig
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mattfbacon

Einmalig!

A tiny crate that allows unsizing FnOnce functions without boxing.

Usage

use einmalig::{DynFnOnce, dyn_fnonce};

fn add(f: impl FnOnce(&str) -> String) -> String {
	add_dyn(dyn_fnonce!(f))
}

fn add_dyn(f: DynFnOnce<'_, &str, String>) -> String {
	f.call("malig!")
}

let prefix = "ein".to_owned();
assert_eq!("einmalig!", add(|x| prefix + x));

License

MIT OR Apache-2.0