Code.ensure_loaded

You're seeing just the function ensure_loaded, go back to Code module for more information.

Specs

ensure_loaded(module()) ::
  {:module, module()}
  | {:error, :embedded | :badfile | :nofile | :on_load_failure}

Ensures the given module is loaded.

If the module is already loaded, this works as no-op. If the module was not yet loaded, it tries to load it.

If it succeeds in loading the module, it returns {:module, module}. If not, returns {:error, reason} with the error reason.

See the module documentation for more information on code loading.

Examples

iex> Code.ensure_loaded(Atom)
{:module, Atom}

iex> Code.ensure_loaded(DoesNotExist)
{:error, :nofile}