pub fn with_ast_parser<T, F: Fn(&ParseSess, &Crate) -> T>(
    path: &Path,
    edition: Edition,
    callback: F
) -> Result<T, String>
Expand description

You can check ParseSess documentation here and Crate documentation here.

And to make things much simpler, I strongly recommend to use the AST visitor. (You can take a look at how to use it with examples/ast.rs.)