anchor.diff:  %% gen_fsm states
   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
   
  +%% @private
  +-spec at_rest(term(), pid(), term()) -> term().
  +at_rest({data, _, _} = Event, _From, State) ->
  +    unexpected_event_warning(at_rest, Event),
  +    {reply, {error, unexpected}, at_rest, State};
  +at_rest(Event, From, State) ->
  +    enqueue_work_or_stop(at_rest, Event, From, State).
  +
  +%% @private
  +-spec wait_response(term(), pid(), term()) -> term().
  +wait_response( {data, Data, FinNoFin}
  +             , _From
  +             , #{stream := StreamRef, pid := Pid} = State) ->
  +    ok = gun:data(Pid, StreamRef, FinNoFin, Data),
  +    {reply, ok, wait_response, State};
  +wait_response(Event, From, State) ->
  +    enqueue_work_or_stop(wait_response, Event, From, State).
  +
  +%% @private
  +-spec receive_data(term(), pid(), term()) -> term().
  +receive_data({data, _, _} = Event, _From, State) ->
  +    unexpected_event_warning(at_rest, Event),
  +    {reply, {error, unexpected}, receive_data, State};
  +receive_data(Event, From, State) ->
  +    enqueue_work_or_stop(receive_data, Event, From, State).
  +
  +%% @private
  +-spec receive_chunk(term(), pid(), term()) -> term().
  +receive_chunk({data, _, _} = Event, _From, State) ->
  +    unexpected_event_warning(at_rest, Event),
  +    {reply, {error, unexpected}, receive_chunk, State};
  +receive_chunk(Event, From, State) ->
  +    enqueue_work_or_stop(receive_chunk, Event, From, State).
  +
   %See if we have work. If we do, dispatch.
   %If we don't, stay in at_rest.
   %% @private
   -spec at_rest(any(), state()) -> {next_state, atom(), state()}.
   at_rest(timeout, State) ->
  -    io:format("at_rest timeout~n"),
       case get_work(State) of
           no_work ->
               {next_state, at_rest, State};
  
positive.code: %% @doc Performs a request to <code>Uri</code> using the HTTP method
  %% specified by <code>Method</code>,  <code>Body</code> as the content data and
  %% <code>Headers</code> as the request's headers.
  -spec request(pid(), http_verb(), iodata(), headers(), iodata(), options()) ->
      result().
  request(Pid, get, Uri, Headers0, Body, Options) ->
      try
  
negative.code:     end.
  
  %% @doc Send data when the
  -spec data(connection(), body()) -> ok | {error, any()}.
  data(Conn, Data) ->
      data(Conn, Data, nofin).
  
  -spec data(connection(), body(), fin | nofin) -> ok | {error, any()}.
  data(Conn, Data, FinNoFin) ->
      gen_fsm:sync_send_event(Conn, {data, Data, FinNoFin}).
  
  %% @doc Returns a list of all received events up to now.
  -spec events(Pid :: pid()) -> [{nofin | fin, reference(), binary()}].
  