Skip to main content

ensure_init

Function ensure_init 

Source
pub fn ensure_init()
Expand description

Initializes igraph for the calling thread, once.

It installs the error and warning handlers of this crate (igraph_set_error_handler, igraph_set_warning_handler), gives the thread its own randomly seeded default random number generator (in igraph 1.0.0 and 1.0.1 the default generator pointer is thread-local, but it initially points to a single global generator shared by all threads, which would make concurrent random functions race; see rng), and calls igraph_setup(). Every safe wrapper calls it (it’s cheap after the first time), so users rarely need to call it explicitly. It is idempotent.