Current section

Files

Jump to
bin_struct lib bin_struct macro decode_field_function.ex
Raw

lib/bin_struct/macro/decode_field_function.ex

defmodule BinStruct.Macro.DecodeFieldFunction do
@moduledoc false
def decode_field_function_implemented_via_decode_all(_env) do
quote do
def decode_field(%__MODULE__{} = struct, field_name_atom) do
%{
^field_name_atom => value
} = __MODULE__.decode(struct)
value
end
end
end
end