anchor.diff:  %% Gets document pointed by given link of document given by key.
   %% @end
   %%--------------------------------------------------------------------
  --spec fetch_link_target(opt_ctx(), ext_key(), link_name()) ->
  +-spec fetch_link_target(opt_ctx(), ext_key() | document(), link_name()) ->
       {ok, document()} | generic_error().
  +fetch_link_target(Ctx, #document{key = Key}, LinkName) ->
  +    fetch_link_target(Ctx, Key, LinkName);
   fetch_link_target(Ctx, Key, LinkName) ->
       case fetch_link(Ctx, Key, LinkName) of
           {ok, _Target = {TargetKey, TargetModel}} ->
  
positive.code: %% In case of Mode == get_leaf, list of all link's uuids is also returned.
  %% @end
  %%--------------------------------------------------------------------
  -spec link_walk(opt_ctx(), Key :: ext_key(), [link_name()], get_leaf | get_all) ->
      {ok, {document(), [ext_key()]} | [document()]} | link_error() | get_error().
  link_walk(Ctx, #document{key = StartKey}, LinkNames, Mode) ->
      link_walk(Ctx, StartKey, LinkNames, Mode);
  
negative.code: %% Executes given function for each link of the document given by key - similar to 'foldl'.
  %% @end
  %%--------------------------------------------------------------------
  -spec foreach_link(opt_ctx(), ext_key() | document(),
      fun((link_name(), link_target(), Acc :: term()) -> Acc :: term()), AccIn :: term()) ->
      {ok, Acc :: term()} | link_error().
  foreach_link(Ctx, #document{key = Key}, Fun, AccIn) ->
      foreach_link(Ctx, Key, Fun, AccIn);
  foreach_link(Ctx, Key, Fun, AccIn) ->
      exec_driver(Ctx, foreach_link, [Key, Fun, AccIn]).
  
  