syn-select-next 0.3.0-alpha.1

A lightweight selector engine for searching Rust source code.
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 2 items with examples
  • Size
  • Source code size: 26.34 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.17 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • dtolnay

syn-select

Build Status Latest Version Documentation

Lightweight path selector for searching Rust code.

mod a {
    mod b {
        trait C {
            fn d(self) {}

            fn f() {}
        }
    }
}

fn main() {
    let src_file = syn::parse_str(include_str!("./rs")).unwrap();

    // This will print out the trait `C`, limited to only function `d`.
    dbg!(syn_select::select("a::b::C::d", &src_file).unwrap());
}

Wildcards

Using _ as a path segment in a wildcard will match any element in that position. For example, in the following:

mod imp {
    struct H;
}

mod imp2 {
    struct H;
}

The selector _::H would match both structs named H.