Crates.io | syn-select |
lib.rs | syn-select |
version | 0.3.0 |
source | src |
created_at | 2019-01-29 02:11:20.842966 |
updated_at | 2023-05-22 15:04:36.866562 |
description | A lightweight selector engine for searching Rust source code. |
homepage | |
repository | https://github.com/TedDriggs/syn-select |
max_upload_size | |
id | 111275 |
size | 25,647 |
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());
}
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
.