DarkMatter.Structs (DarkMatter v1.1.4) View Source
Utils for working with structs.
Link to this section Summary
Functions
Reduce a map with only non nil default values for a given module
.
Determine keys for a given module
or raises ArgumentError
.
Determine if a given key
is a meta map property.
Link to this section Functions
Specs
Reduce a map with only non nil default values for a given module
.
Specs
Determine keys for a given module
or raises ArgumentError
.
Examples
iex> keys(IO.Stream)
[:device, :line_or_bytes, :raw]
iex> keys(%IO.Stream{})
[:device, :line_or_bytes, :raw]
iex> keys(%{})
** (FunctionClauseError) no function clause matching in DarkMatter.Structs.keys/1
Specs
Determine if a given key
is a meta map property.
Examples
iex> meta_key?(:__meta__)
true
iex> meta_key?(:__struct__)
true
iex> meta_key?(:non_meta)
false