Function rayon::initialize [] [src]

pub fn initialize(config: Configuration) -> Result<(), InitError>

Initializes the global thread pool. This initialization is optional. If you do not call this function, the thread pool will be automatically initialized with the default configuration. In fact, calling initialize is not recommended, except for in two scenarios:

Initialization of the global thread pool happens exactly once. Once started, the configuration cannot be changed. Therefore, if you call initialize a second time, it will simply check that the global thread pool already has the configuration you requested, rather than making changes.

An Ok result indicates that the thread pool is running with the given configuration. Otherwise, a suitable error is returned.