Tuple type of the function arguments.
The resolved type of the Promise returned by the async function.
Readonly[toThe well-known symbol Symbol.toStringTag used by Object.prototype.toString().
Returns 'FnOnceAsync' so that Object.prototype.toString.call(fn) produces '[object FnOnceAsync]'.
Attempts to call the async 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 due to consumption.
The returned Promise may still reject if the underlying async function throws.
The arguments to pass to the function.
A Promise that resolves to Some(result) if the function was called, None if already consumed.
An async 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
AsyncFnOncetrait (stabilized in Rust 1.85), which represents async closures that take ownership of captured variables and can only be called once.Use cases:
Since
1.8.0
See
FnOnce for sync one-time callable functions
Example
Example
Example