dioxus-grpc provides a convenient way to use gRPC with Dioxus
Example
syntax = "proto3";
package helloworld;
service Greeter {
rpc SayHello (HelloRequest) returns (HelloReply) {}
}
message HelloRequest {
string name = 1;
}
message HelloReply {
string message = 1;
}
A complete example can be found here: ./examples/
How to use ?
To use it, you will need to also use tonic-build and disable the transport feature. Therefore, something like:
[]
= "*"
= { = "0.13", = false, = ["prost"] }
But, you will also need to import some runtime dependencies:
[]
= { = "0.6", = ["web"] }
= { = "0.13", = false, = ["codegen", "prost"] }
= "0.13"
= "0.7"
Once this is done, you can call generate_hooks in ./build.rs. See the examples for more details.