Skip to content

Migrate Rust examples to SDK 0.11.0 service API#407

Merged
slinkydeveloper merged 1 commit into
mainfrom
rust-sdk-0.11-service-api
Jul 21, 2026
Merged

Migrate Rust examples to SDK 0.11.0 service API#407
slinkydeveloper merged 1 commit into
mainfrom
rust-sdk-0.11-service-api

Conversation

@slinkydeveloper

Copy link
Copy Markdown
Contributor

What

Rust SDK 0.11.0 changes how services are defined. The old trait-based definition is deprecated in favor of a struct-based one:

  • The #[service] / #[object] / #[workflow] macro now goes on the struct's impl block (no separate trait).
  • Each handler is annotated with #[handler].
  • Shared vs. exclusive is inferred from the context type (ObjectContext vs SharedObjectContext, WorkflowContext vs SharedWorkflowContext) — no more #[shared].
  • Services are bound with .bind(Struct) instead of .bind(StructImpl.serve()).

Changes

Migrated every Rust example to the new API:

  • rust/basicsp0_durable_execution, p1_building_blocks, p2_virtual_objects, p3_workflows, and stubs
  • rust/templates/rust
  • rust/templates/rust-shuttle

Service and handler names are preserved, so HTTP endpoints and generated clients (e.g. SubscriptionServiceClient) are unchanged.

Verification

cargo build passes for all three projects (rust/basics --examples, rust/templates/rust, rust/templates/rust-shuttle) against restate-sdk = "0.11.0".

🤖 Generated with Claude Code

The Rust SDK 0.11.0 replaces the trait-based service definition with a
struct-based one: the macro (#[service]/#[object]/#[workflow]) goes on
the struct's impl block, each handler is annotated with #[handler], and
shared/exclusive is inferred from the context type. Services are bound
with .bind(Struct) instead of .bind(StructImpl.serve()).

Updates all examples in rust/basics and both rust/templates. Service and
handler names are preserved, so HTTP endpoints and generated clients
(e.g. SubscriptionServiceClient) are unchanged.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@slinkydeveloper
slinkydeveloper merged commit a6a8a80 into main Jul 21, 2026
8 checks passed
@slinkydeveloper
slinkydeveloper deleted the rust-sdk-0.11-service-api branch July 21, 2026 10:04
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant