Comments (5)
Thanks for the suggestion! I agree this could be supported.
It'd be nice to replace the derive_serde
arg with something generic enough to support this new use case. Maybe something like this would be possible:
#[tarpc::service(derive = [tarpc::serde::Serialize, tarpc::serde::Deserialize, Clone, Hash])]
service World {
async fn hello(message: String) -> String;
}
from tarpc.
@tikue Got a first cut up on a branch: https://github.com/ShaneMurphy2/tarpc/tree/customizable-derives, let me know what you think so far.
Still need to see what breaks by changing the macro syntax, but the core use case works.
from tarpc.
Looks nice! It'd be nice for derive_serde
and derive
to be mutually exclusive, so that people are encouraged to make the switch. In particular:
derive_serde
andderive
at the same time should be an errorderive
should only derive Serialize/Deserialize when they are explicitly listedderive_serde
is deprecated - output a warning when it is used, and suggest instead using eitherderive = []
to disable, orderive = [Serialize, Deserialize]
to explicitly enable- for backwards compatibility, absence of
derive
can derive Serialize/Deserialize by default.
from tarpc.
Looks nice! It'd be nice for
derive_serde
andderive
to be mutually exclusive, so that people are encouraged to make the switch. In particular:
derive_serde
andderive
at the same time should be an errorderive
should only derive Serialize/Deserialize when they are explicitly listedderive_serde
is deprecated - output a warning when it is used, and suggest instead using eitherderive = []
to disable, orderive = [Serialize, Deserialize]
to explicitly enable- for backwards compatibility, absence of
derive
can derive Serialize/Deserialize by default.
On it π
from tarpc.
@tikue PR is up!
from tarpc.
Related Issues (20)
- Design problem, how to call other structs method ?
- Server-side span with clientβs span as parent HOT 4
- Recommended way for connection pooling? HOT 4
- Support for Async Fn in Trait? HOT 3
- Generic type parameters HOT 4
- On client's read errors quick subsequent requests may wait for response indefinitely HOT 9
- Adding client ID to identify clients (and retrieve specific context)? HOT 2
- Associated data with client
- Future returned by `Serve::serve()` is not `Send` HOT 11
- Rkyv support?
- Json support and automatic documentation generation HOT 2
- Feature: cli support for translating defined placeholder to generate proto from codebase directly
- tarpc make crash when c++ Destructor execute
- Distributed tracing with TextMapPropagator HOT 1
- Readme example doesn't compile HOT 6
- how to use it in client browser? HOT 2
- How to implement client authentication? HOT 7
- Initialize tarpc listener with custom variable for use in functions HOT 1
- How to implement router? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tarpc.