I have a code like this:
#[my_attribute]
impl<T> Foo<T> for Bar where T: Baz { ... }
How to get the Foo<T> part from ItemImpl?
I have a code like this:
#[my_attribute]
impl<T> Foo<T> for Bar where T: Baz { ... }
How to get the Foo<T> part from ItemImpl?
Copyright © 2021 Jogjafile Inc.
The
trait_field ofItemImplcontains the information you are interested inIt's an
Optionas impl blocks don't have to implement a trait (e.g.impl Baz { }). From the inner three-tuple, you are intersted in the second item, thePath. That contains yourFoo<T>.