Skip to content

NoraCodes/whiteout

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

whiteout

crates.io badge documentation License: MIT

whiteout provides macros that erase the type of any value into an impl Trait for a given trait. This gives you a value that can only be use with the methods of that trait, and whose type is unnameable.

#[macro_use] extern crate whiteout;
fn main() {
    let a = erase!(10, std:ops::Add<i64, Output=i64>);
    assert_eq!(a + 10, 20);
}

Since we sometimes want to use these values together, whiteout provides both a one-time macro and a macro that produces a function which returns a consistent unnameable type, allowing multiple erased values to be used in conjunction. See the documentation for more info.

About

Utilities for describing the types of values by their behavior

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages