pub enum Purpose {
BoundImpl,
Declare,
}
Expand description
The goal of tracing generic parameter usage.
Not all uses of type parameters imply a need to add bounds to a generated trait impl.
For example, a field of type <Vec<T> as a::b::Trait>::Associated
does not need a
where T: Serialize
bound in serde
.
However, a proc macro that is attempting to generate a helper struct would need to
know about this usage, or else the generated code would reference an unknown type T
and fail to compile.
Variants§
BoundImpl
The tracing is being used to generate an impl
block.
Uses such as syn::TypePath.qself
will not be returned.
Declare
The tracing is being used to generate a new struct or enum.
All uses will be returned.
Trait Implementations§
impl Copy for Purpose
impl Eq for Purpose
impl StructuralPartialEq for Purpose
Auto Trait Implementations§
impl Freeze for Purpose
impl RefUnwindSafe for Purpose
impl Send for Purpose
impl Sync for Purpose
impl Unpin for Purpose
impl UnwindSafe for Purpose
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)