Trait query_interface::HasInterface
[−]
[src]
pub unsafe trait HasInterface<I: ?Sized> { }
You can use this trait to ensure that a type implements a trait as an
interface. This means the type declared the trait in its interfaces!(...)
list, and guarantees that querying an Object
of that type for the trait
will always succeed.
When using HasInterface<SomeTrait>
in a generic bound, you should also
specify SomeTrait
as a bound. While HasInterface<SomeTrait>
is a more
stringent requirement than, and in practice implies SomeTrait
, the
compiler cannot deduce that because it is enforced through macros rather
than the type system.