Crate syn_select

Source
Expand description

Library to get a specific element by path in Rust code.

§Usage

let file: syn::File = syn::parse_str(
    r#"
    mod a {
        mod b {
            trait C {
                fn d(self) {}
                fn f() {}
            }
        }
    }"#).unwrap();
let results = syn_select::select("a::b::C::d", &file).unwrap();
assert_eq!(results.len(), 1);

Structs§

Error
An error encountered while parsing or executing a selector.
Selector
The path provided by the user to search for.

Functions§

select
Parse a path, then search a file for all results that exactly match the specified path.
OSZAR »