Skip to content

Add ingress-client API with typed reqwest clients, docs, and integration coverage#100

Open
robertream wants to merge 9 commits into
restatedev:mainfrom
robertream:client-macro
Open

Add ingress-client API with typed reqwest clients, docs, and integration coverage#100
robertream wants to merge 9 commits into
restatedev:mainfrom
robertream:client-macro

Conversation

@robertream
Copy link
Copy Markdown

Summary

Adds a new ingress-client capability to the Rust SDK with a typed reqwest-based client API, macro-generated typed ingress clients, and runtime/compile-time test coverage.

Included in this commit

New ingress client module

  • Added src/ingress.rs with:
    • Client
    • ServerUrl (+ TryFrom conversions)
    • AuthToken
    • Request<Res>
    • RequestError
  • Request customization support:
    • headers
    • idempotency key
    • timeout
    • delay query parameter

Macro-generated typed ingress clients

  • Updated macros/src/generator.rs to generate typed ingress client impls for services, objects, and workflows.
  • Generated ingress interfaces use request-oriented trait naming (Into*Request, Request<'a>, create_request).

Crate exports

  • Updated src/lib.rs and feature wiring so ingress client APIs are available behind ingress-client.

Tests

  • Added tests/ingress.rs runtime coverage for ingress behavior, including:
    • typed service/object/workflow invocation
    • auth token validation
    • status propagation
    • idempotency header propagation
    • serialize failure propagation
    • delay=...ms query serialization
  • Updated compile/UI tests for feature-gated ingress paths:
    • tests/compiletest.rs
    • tests/ui/ingress-client/*

Testcontainers

  • Added ingress-client feature forwarding in testcontainers/Cargo.toml.
  • Updated testcontainers/tests/test_container.rs to include a feature-gated typed ingress client integration path alongside the existing HTTP-based one.

Documentation

  • Added module-level ingress docs and typed usage examples.
  • Added API docs for ingress structs/methods and RequestError variants.
  • Added/updated doctests for key ingress entry points.

Validation

  • cargo test -q
  • cargo test --features ingress-client -q
  • cargo test -p restate-sdk-testcontainers --no-run
  • cargo test -p restate-sdk-testcontainers --features ingress-client --no-run

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Feb 20, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@robertream
Copy link
Copy Markdown
Author

I hadn't read the original issue and PR from a year ago. I updated the implementation to support the "executor" API that was suggested.

@robertream
Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

@tillrohrmann tillrohrmann mentioned this pull request Feb 23, 2026
@tillrohrmann tillrohrmann linked an issue Feb 23, 2026 that may be closed by this pull request
@tillrohrmann
Copy link
Copy Markdown
Contributor

Thanks a lot for creating this PR @robertream. It's quite a piece of work you have contributed 👏 We will probably need a little bit of time for reviewing your design and the code. Having typed clients for Rust would be kick-ass :-)

cc @slinkydeveloper for your input.

Comment thread src/ingress.rs Outdated
robertream and others added 3 commits March 20, 2026 04:37
Adds a `ServiceClient` trait with `const SERVICE_NAME: &'static str` as the
base for all generated client types. Introduces `KeyedClient` for objects and
workflows (keyed services), with `IntoObjectClient` and `IntoWorkflowClient`
as marker subtypes for type-safe dispatch.

This provides a unified way to access the service name from any generated
client, enabling features like link/unlink that need the child service name.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robertream robertream requested a review from myypo May 5, 2026 22:39
The upstream Deserialize trait now has an associated Error type. Relax the
ingress `call()` and `decode_response()` bounds from requiring
`Error = serde_json::Error` to accepting any error type convertible to
RequestError via `From`.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ingress Client

3 participants