Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Q: is it possible to use grpc-rs with plain C based Protocol Buffers? #592

Open
mw66 opened this issue Oct 18, 2022 · 1 comment
Open

Q: is it possible to use grpc-rs with plain C based Protocol Buffers? #592

mw66 opened this issue Oct 18, 2022 · 1 comment

Comments

@mw66
Copy link

mw66 commented Oct 18, 2022

Hi,

Maybe this is a silly question: but is it possible to use grpc-rs with plain C based Protocol Buffers ? e.g.

https://github.com/nanopb/nanopb (for memory restricted system).

https://github.com/protobuf-c/protobuf-c

I think the output of those library are just C's struct, is it possible to use grpc-rs with these struct to achieve network communication?

Thanks!

@BusyJay
Copy link
Member

BusyJay commented Oct 19, 2022

Yes, but since grpc-rs is written in Rust, you may need to build up some bindings between C library and Rust.

grpc-rs runtime is developed without depending on specific codec, you can provide your known codec, check how it works in https://github.com/tikv/grpc-rs/blob/master/src/codec.rs. But gRPC is hard to used without a compiler, and compiler has to depend on specific codec. So to use a different protobuf library, you need to 1. provide codec function, 2. write a grpc compiler.

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

No branches or pull requests

2 participants