View Source erl_features (stdlib v6.0)

This module contains functions for supporting features that can be enabled/disabled in Erlang.

It should be considered as mostly for internal use, although there are some functions that might be useful when writing tools.

Summary

Functions

Return a list of all known features. This list will include features that have been removed (status rejected) and features that are no longer configurable (status permanent).

Return a list of all configurable features, that is, features with status experimental or approved. These are the features that can be enabled or disabled.

Return a list of the features that are currently enabled. Note that the set of enabled is set during startup and can then not be changed.

Return a map containing information about the given feature.

Return the list of features enabled when compiling the module. The module need not be loaded, but is found if it exists in the loadpath. If not all features used by the module are enabled in the runtime, loading the module is not allowed.

Types

Link to this type

feature()

View Source (not exported) (since OTP 25.0)
-type feature() :: atom().
Link to this type

release()

View Source (not exported) (since OTP 25.0)
-type release() :: non_neg_integer().
Link to this type

status()

View Source (not exported) (since OTP 25.0)
-type status() :: experimental | approved | permanent | rejected.
Link to this type

type()

View Source (not exported) (since OTP 25.0)
-type type() :: extension | backwards_incompatible_change.

Functions

-spec all() -> [feature()].

Return a list of all known features. This list will include features that have been removed (status rejected) and features that are no longer configurable (status permanent).

Link to this function

configurable()

View Source (since OTP 25.1)
-spec configurable() -> [feature()].

Return a list of all configurable features, that is, features with status experimental or approved. These are the features that can be enabled or disabled.

Link to this function

enabled()

View Source (since OTP 25.0)
-spec enabled() -> [feature()].

Return a list of the features that are currently enabled. Note that the set of enabled is set during startup and can then not be changed.

Link to this function

info(Feature)

View Source (since OTP 25.0)
-spec info(feature()) -> FeatureInfoMap | no_return()
              when
                  Description :: string(),
                  FeatureInfoMap ::
                      #{description := Description,
                        short := Description,
                        type := type(),
                        keywords := [atom()],
                        status := status(),
                        experimental => release(),
                        approved => release(),
                        permanent => release(),
                        rejected => release()}.

Return a map containing information about the given feature.

-spec used(module() | file:filename()) -> [feature()].

Return the list of features enabled when compiling the module. The module need not be loaded, but is found if it exists in the loadpath. If not all features used by the module are enabled in the runtime, loading the module is not allowed.