-module(typed_headers@header). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function, nowarn_nomatch]). -export([to_string/1]). -export_type([header/0]). -type header() :: {content_type, typed_headers@content_type:content_type()} | {custom, binary(), binary()} | {raw, binary()}. -spec h(binary(), binary()) -> binary(). h(Name, Value) -> <<<>/binary, Value/binary>>. -spec to_string(header()) -> binary(). to_string(Header) -> case Header of {content_type, C} -> h(<<"Content-Type"/utf8>>, typed_headers@content_type:to_string(C)); {custom, Name, Value} -> h(Name, Value); {raw, S} -> S end.