Macro inspect_type::instance_of
source · macro_rules! instance_of { ( $( $arg : tt )+ ) => { ... }; }
Expand description
Macro instance_of to answer the question: does it implement a trait? Alias of the macro implements.
Basic use-case.
use inspect_type::instance_of;
dbg!( instance_of!( 13_i32 => Copy ) );
// < instance_of!( 13_i32 => Copy ) : true
dbg!( instance_of!( Box::new( 13_i32 ) => Copy ) );
// < instance_of!( 13_i32 => Copy ) : false