Conversation
There was a problem hiding this comment.
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
servicemacro 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/servicemacros 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.
instead of manual implementation.
This is a forgotten change from commit 2737050.
9f3ab5f to
b5912bd
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
servicenow allows returning borrowed errors.in sample code commentsservicemacroServicerecommend use ofservicemacroFixes #212.