xur_

> module

std::reflect::func

function signatures

use std::reflect::func; in the browser

Inspects a function value: a named function, a closure, an enum or struct constructor, or a native function. Native functions report only their name and parameter count. Anything else is a runtime error.

> functions

# name(f: fn) -> str

The function's name.

# param_names(f: fn) -> list<str>

Its parameter names, with "_" for a parameter that is a pattern.

# param_types(f: fn) -> list<Option<type>>

Its parameter types, None where a parameter has no type annotation.

# params(f: fn) -> i64

How many parameters it takes.

# return_type(f: fn) -> Option<type>

Its return type, or None when it isn't declared.