#tuple #generics #variadic #traits #attempt #lack #rusts

no-std variadic_generics

A first attempt in using traits & tuples to work around Rusts lack of variadic generics

3 releases

0.1.2 Nov 9, 2021
0.1.1 Apr 7, 2017
0.1.0 Apr 7, 2017

#2039 in Rust patterns


Used in 2 crates

MIT license

17KB
162 lines

variadic_generics

A first attempt in using traits & tuples to work around Rusts lack of variadic generics.

example usage

Add to your Cargo.toml:

[dependencies]
variadic_generics = "0.1"

Add to your crate root:

#[macro_use]
extern crate variadic_generics;
  • option_tuple showcases how to implement flatwrap(Option<T>...) -> Option<(T...)>

contribution guidelines

Make sure to cargo install rustfmt and cargo fmt the codebase before creating any commits!

No runtime deps