| Crates.io | implements |
| lib.rs | implements |
| version | 0.13.0 |
| created_at | 2021-11-29 07:05:56.723889+00 |
| updated_at | 2025-06-21 07:31:48.116426+00 |
| description | Macro to answer the question: does it implement a trait? |
| homepage | https://github.com/Wandalen/wTools/tree/master/module/core/implements |
| repository | https://github.com/Wandalen/wTools/tree/master/module/core/implements |
| max_upload_size | |
| id | 489116 |
| size | 17,206 |
Macro to answer the question: does it implement a trait?
This solution has a limitation:
Fn/FnMut/FnOnce which current entity does not implement you will get compile-time error instead of false.use implements::*;
dbg!( implements!( 13_i32 => Copy ) );
// < implements!( 13_i32 => Copy ) : true
dbg!( implements!( Box::new( 13_i32 ) => Copy ) );
// < implements!( 13_i32 => Copy ) : false
cargo add implements
git clone https://github.com/Wandalen/wTools
cd wTools
cargo run --example implements_trivial