condtype
Choose Rust types via boolean conditions, brought to you by Nikolai Vazquez.
If you find this crate useful, consider starring it as well as sponsoring or donating once. 💖
Examples
This crate enables choosing a type based on a compile-time constant, just like
std::conditional_t in C++.
use CondType;
let str: = "hello";
let int: = 42;
// Unsized types are also supported:
let str: & = "world";
Install
This crate is available on crates.io and can be
used by running the following cargo command in your project directory:
or by manually adding the following to your project's Cargo.toml:
[]
= "1.0.0"
License
Like the Rust project, this library may be used under either the MIT License or Apache License (Version 2.0).