Questions tagged [prost]

PROST! a Protocol Buffers implementation for the Rust Language

https://github.com/danburkert/prost

23 questions
0
votes
0 answers

Parse gRPC orginal body with Tonic Prost

I have an original body of a gRPC request that I want to decode to a Protobuf Message using Prost (and probably Tonic). As I see the HTTP body part consist of a grpc-header + protobuf-message. In my case the header is just 5 bytes like 000000003b,…
Igor Artamonov
  • 35,450
  • 10
  • 82
  • 113
0
votes
1 answer

Error using package name as "proto.messages.v1" in .proto with prost, and tonic in rust

I'm new to Rust and trying to create a simple gRPC application. Here is the directory structure: grpc-protobuf ├── Cargo.toml ├── build.rs ├── proto │   ├── hello │   │   └── hello.proto │   └── messages │   └── hello.proto └── src └──…
Gaurav Gahlot
  • 1,583
  • 3
  • 14
  • 19
0
votes
1 answer

How to obtain Prost! enum from String

The generated enum type looks like this, although I don't really have access to the src as it's generated by Prost! during the build: #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum…
jsstuball
  • 4,104
  • 7
  • 33
  • 63
0
votes
1 answer

[Best practice for optional in proto or default value

We are setting up our rust services and using prost-build to bridge between proto <-> rust land. Our proto definitions are in proto3 Lets take the following proto message: message Test { string id = 1; string body = 2; string maybe_nullable_thing =…
0
votes
1 answer

Cannot determine return type for grpc stream

I am trying to implement a simple stream rpc using tonic and grpc. I have been following the routeguide tutorial. When I try to return a tokio_stream::wrappers::ReceiverStream from my stream method I get compile error indicating I should return a…
Babbleshack
  • 341
  • 1
  • 5
  • 16
0
votes
1 answer

Can't Convert SystemTime to Prost 0.10/Protobuf Timestamp Type

Can somebody tell me what is happening with the types in tonic and prost? Only a month or two ago, my team had a working build that used a protobuf definition that contained a timestamp. We're compiling them with tonic_build using well known types.…
user14487166
0
votes
1 answer

Compiler Unaware of Provided Methods of Trait

I'm using the prost crate in a very "hello world" way, with a basic ProtoBuf file: foo.proto syntax = "proto3"; package foo; message Foo { string mystring = 1; } I can verify the types that prost produces at compile time by inspecting…
armani
  • 93
  • 1
  • 10
  • 23
0
votes
0 answers

Function accept type argument

I am working on a client server application where i send messages to / from each as protocol buffers using the rust crate prost. currently i have a generic send_message function that can take any struct that implements the prost::Message trait. …
matthewmturner
  • 566
  • 7
  • 21
1
2