alef 0.103.2

Opinionated polyglot binding generator for Rust libraries
Documentation
{#- Once-per-suite mock-request-count helper (alef issue #443).

   Context variables (see src/e2e/codegen/mock_assertions/helper.rs for the full contract):
   - helper_name: function name
   - total_path: mock server's total-count endpoint path
   - one_path: mock server's single-key endpoint path

   Emits ONE module-private top-level function using `gleam_httpc` against `MOCK_SERVER_URL`,
   matching this backend's existing `http.rs` idiom (`GleamTestClientRenderer::render_call` reads
   the same env var the same way, falling back to "http://localhost:8080"). `gleam_httpc` /
   `gleam_http` / `envoy` are already `gleam.toml` dependencies (see
   `project::render_gleam_toml`) -- this helper adds no new one. Callers build `path_and_query`
   from "{{ total_path }}?prefix=<p>" (mock.requests.total) or "{{ one_path }}?key=<k>"
   (mock.requests["<k>"]) -- see mock_assertions::model::MockQuery. `test_file.rs` gates the
   imports this body needs (`gleam/httpc`, `gleam/http/request`, `gleam/int`, `gleam/string`,
   `envoy`) on this same helper actually being referenced.
#}

fn {{ helper_name }}(base_url: String, path_and_query: String) -> Int {
  let assert Ok(req) = request.to(base_url <> path_and_query)
  let assert Ok(resp) = httpc.send(req)
  let assert Ok(count) = int.parse(string.trim(resp.body))
  count
}