This crate provides has_impl!(type: Trait) macro to check if Trait is implemented for type at complie time
has_impl!(type: Trait)
Trait
type
use has_impl::*; trait Foo {} impl Foo for i32 {} fn main() { assert_eq!(has_impl!(i32: Foo), true); }