Skip to main content

Module callable_once

Module callable_once 

Source
Expand description

§Callable Once Types

Provides fallible, one-time, zero-argument computations.

A CallableOnce<R, E> is equivalent to FnOnce() -> Result<R, E>, but uses task-oriented vocabulary. Use it when the operation is a computation or task whose success value matters. Use RunnableOnce<E> when the operation only needs to report success or failure.

The trait itself does not require Send; concurrent executors should add + Send + 'static at their API boundary.

§Author

Haixing Hu

Structs§

BoxCallableOnce
Box-based one-time callable.

Traits§

CallableOnce
A fallible one-time computation.