(fun) - Rust
function declarations
clojure
(fun name? args?)Where:
Matching:
- functions, e.g.
fn foo() {} - async functions, e.g.
async fn foo() {}
Behavior
- Matches function declarations, not closures.
Examples
Find entry-point functions across a crate.
clojure
(fun (id main))Selects in lines { 1 } but not in { 2 }:
rust
fn main() {}
fn main_loop() {}Find functions that expect a ctx parameter first.
clojure
(fun _ (arg 1 (id ctx)))Selects in lines { 1 } but not in { 2 }:
rust
fn handle(ctx: &Context, req: Request) {}
fn render(req: Request) {}Arguments
name
- Identifier: shorthand for (id)
- Pattern: shorthand for (id)
- (id)
- (:into)
- (:nearest)
- (:and)
- (:or)
- (:not)
- (:text)
- (:kind)
- (:replace)
- (:replace-in)
- (:capture)