檢視原始碼 erl_features (stdlib v6.2)
此模組包含支援 Erlang 中可啟用/停用功能的函式。
它主要應被視為內部使用,儘管有些函式在編寫工具時可能很有用。
概要
函式
返回所有已知功能的列表。此列表將包含已移除(狀態為 rejected
)和不再可配置(狀態為 permanent
)的功能。
返回所有可配置功能的列表,也就是狀態為 experimental
或 approved
的功能。這些是可以啟用或停用的功能。
返回目前已啟用的功能列表。請注意,啟用的功能集是在啟動期間設定的,之後無法更改。
返回一個包含給定功能相關資訊的映射。
返回編譯模組時啟用的功能列表。該模組不一定要載入,但如果它存在於載入路徑中就會被找到。如果模組使用的所有功能在執行時未啟用,則不允許載入該模組。
型別
-type feature() :: atom().
-type release() :: non_neg_integer().
-type status() :: experimental | approved | permanent | rejected.
-type type() :: extension | backwards_incompatible_change.
函式
-spec all() -> [feature()].
返回所有已知功能的列表。此列表將包含已移除(狀態為 rejected
)和不再可配置(狀態為 permanent
)的功能。
-spec configurable() -> [feature()].
返回所有可配置功能的列表,也就是狀態為 experimental
或 approved
的功能。這些是可以啟用或停用的功能。
-spec enabled() -> [feature()].
返回目前已啟用的功能列表。請注意,啟用的功能集是在啟動期間設定的,之後無法更改。
-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()}.
返回一個包含給定功能相關資訊的映射。
-spec used(module() | file:filename()) -> [feature()].
返回編譯模組時啟用的功能列表。該模組不一定要載入,但如果它存在於載入路徑中就會被找到。如果模組使用的所有功能在執行時未啟用,則不允許載入該模組。