syn-select-next

Crates.iosyn-select-next
lib.rssyn-select-next
version0.3.0-alpha.1
sourcesrc
created_at2023-03-23 01:13:39.641864
updated_at2023-03-23 01:13:39.641864
descriptionA lightweight selector engine for searching Rust source code.
homepage
repositoryhttps://github.com/TedDriggs/syn-select/pull/11
max_upload_size
id817665
size25,724
Lanthanum (github:zxtn:lanthanum)

documentation

https://docs.rs/syn-select/0.2.0

README

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.

Commit count: 22

cargo fmt