Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Builder API

Builder options

MethodDescription
MethodQuery::new(type_name)Start a query for the given type
.deps(toml)TOML dependency string for third-party crates
.filter(query)Narrow results by name (exact > prefix > substring)
.run(&ra_path)Execute and return Vec<Method>
.run_with_definitions(&ra_path)Execute and return Vec<MethodResult> with source locations

builder_run.rs

use rust_meth_lib::analyzer::find_rust_analyzer;
use rust_meth_lib::query::MethodQuery;

fn main() -> rust_meth_lib::error::Result<()> {
    let ra_path = find_rust_analyzer()?;

    let methods = MethodQuery::new("String").filter("push").run(&ra_path)?;

    println!("String methods matching \"push\":");
    for m in &methods {
        let sig = m.detail.as_deref().unwrap_or("(no signature)");
        println!("  {}  →  {sig}", m.name);
    }

    Ok(())
}

Output

String methods matching "push":
  push  →  fn(&mut self, char)
  push_str  →  fn(&mut self, &str)