data MethodInfo
Comptime description of a method.
Example:
use std.reflect { reflect }
data Counter {
n: i32
}
impl Counter {
fn get() -> i32 => self.n
fn show() io { print("{self.n}") }
}
fn main() io {
inline for m in reflect(Counter).methods {
print("{m.name}/{m.params.len} -> {m.ret.name} pure={m.isPure}")
}
}Вывод
get/0 -> i32 pure=true show/0 -> () pure=false
pub(api) data MethodInfoС версии. 1.0.0-beta
Определено в: std/reflect/reflect.oxl:121