Skip to content

Recommend service macro#224

Merged
zeenix merged 8 commits intoz-galaxy:mainfrom
zeenix:service-in-docs
Feb 16, 2026
Merged

Recommend service macro#224
zeenix merged 8 commits intoz-galaxy:mainfrom
zeenix:service-in-docs

Conversation

@zeenix
Copy link
Collaborator

@zeenix zeenix commented Feb 12, 2026

  • ✨ macros: service now allows returning borrowed errors
  • 💡 README: Add missing . in sample code comments
  • 📝 README: Use & recommend service macro
  • 📝 core: Recommend high-level API in Connection docs
  • 📝 core: Service recommend use of service macro

Fixes #212.

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 12, 2026

Merging this PR will not alter performance

✅ 4 untouched benchmarks


Comparing zeenix:service-in-docs (b5912bd) with main (f35ed2a)

Open in CodSpeed

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the docs and examples across the repo to recommend using the high-level #[service] attribute macro (instead of manually implementing Service), and extends the service macro codegen so it can correctly handle borrowed lifetimes in parameters/returns/errors.

Changes:

  • Update service macro codegen to normalize lifetimes for (de)serialization so borrowed types work.
  • Add a new macro test covering borrowed lifetimes in return/error types.
  • Refresh README + core docs to recommend the proxy/service macros and adjust the main example accordingly.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
zlink-macros/tests/service/borrowed-types.rs New integration test covering borrowed lifetimes in service return/error types.
zlink-macros/tests/service.rs Registers the new borrowed-types test module.
zlink-macros/src/service/codegen.rs Converts lifetimes to synthetic '__de/'__ser to support borrowed types in generated enums.
zlink-core/src/server/service.rs Adds docs recommending #[service] for implementing Service.
zlink-core/src/connection/mod.rs Expands module docs to recommend proxy + service macros over the low-level API.
README.md Updates the public example to use #[proxy]/#[service] and fixes comment punctuation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zeenix zeenix merged commit db28f86 into z-galaxy:main Feb 16, 2026
15 checks passed
@zeenix zeenix deleted the service-in-docs branch February 16, 2026 20:19
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.

Update docs & tests to use & recommend service attribute macro

2 participants