| 1 | use syn::{ |
| 2 | parse::{Parse, ParseStream}, |
| 3 | Generics, |
| 4 | }; |
| 5 | |
| 6 | //////////////////////////////////////////////////////////////////////////////// |
| 7 | |
| 8 | pub(crate) struct ImplHeader { |
| 9 | pub(crate) generics: Generics, |
| 10 | pub(crate) self_ty: syn::Path, |
| 11 | } |
| 12 | |
| 13 | impl Parse for ImplHeader { |
| 14 | fn parse(input: ParseStream) -> Result<Self, syn::Error> { |
| 15 | let mut generics = input.parse::<Generics>()?; |
| 16 | |
| 17 | let self_ty = input.parse()?; |
| 18 | |
| 19 | generics.where_clause = input.parse()?; |
| 20 | |
| 21 | Ok(Self { generics, self_ty }) |
| 22 | } |
| 23 | } |