Tuple type of the function arguments.
Return type of the function.
Readonly[toThe well-known symbol Symbol.toStringTag used by Object.prototype.toString().
Returns 'FnOnce' so that Object.prototype.toString.call(fn) produces '[object FnOnce]'.
Attempts to call the function, returning Some(result) if successful
or None if the function has already been consumed.
This is the safe alternative to call() that never throws.
The arguments to pass to the function.
Some(result) if the function was called, None if already consumed.
A function wrapper that can only be called once.
After the first invocation, the function is consumed and cannot be called again. This mirrors Rust's
FnOncetrait, which represents closures that take ownership of captured variables and can only be called once.Use cases:
Since
1.8.0
See
Example
Example
Example