1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use proc_macro2::TokenStream;
use syn::{
    self,
    parse::{Parse, ParseStream},
    Attribute,
};

pub struct Input {
    pub attrs: Vec<Attribute>,
    pub rest: TokenStream,
}

impl Parse for Input {
    fn parse(input: ParseStream) -> syn::Result<Self> {
        let attrs = input.call(Attribute::parse_outer)?;
        let rest = input.parse()?;
        Ok(Input { attrs, rest })
    }
}