The type of a function in Rune.
Functions can be called using call expression syntax, such as <expr>()
.
There are multiple different kind of things which can be coerced into a function in Rune:
- Regular functions.
- Closures (which might or might not capture their environment).
- Built-in constructors for tuple types (tuple structs, tuple variants).
Examples
// Captures the constructor for the `Some(<value>)` tuple variant.
let build_some = Some;
assert_eq!;
// Captures the function previously defined.
let build_some = build;
assert_eq!;
Trait Implementations
impl Clone
for Function
Clone the specified value
.
Examples
let a = 42;
let b = a;
let c = a.clone;
a += 1;
assert_eq!;
assert_eq!;
assert_eq!;
Protocols
protocol CLONE
let $out = clone
Clone a function.
Examples
let a = function;
let b = a.clone;
assert_eq!;