• Stars
    star
    150
  • Rank 247,323 (Top 5 %)
  • Language
    Rust
  • License
    Apache License 2.0
  • Created almost 3 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

protoc-gen-prost

A protoc plugin that generates code using the Prost! code generation engine.

When used in projects that use only Rust code, the preferred mechanism for generating protobuf definitions with Prost! is to use prost-build from within a build.rs file. However, when working in polyglot environments, it can be advantageous to utilize common tooling in the Protocol Buffers ecosystem. One common tool used for this purpose is buf, which simplifies the code generation process and includes several useful features, including linting, package management, and breaking change detection.

Usage

The various modules that are used for generating Rust code with Prost! and Tonic are available in the named subdirectories. Refer to the README in each of those folders for more information.

Example buf.gen.yaml

Note: When executing protoc-gen-prost-crate with the gen_crate option, remote generation is not possible, as the manifest template is not made available to a remote plugin.

version: v1
plugins:
  - plugin: buf.build/community/neoeinstein-prost:v0.2.3
    out: gen/src
    opt:
      - bytes=.
      - compile_well_known_types
      - extern_path=.google.protobuf=::pbjson_types
      - file_descriptor_set
  - plugin: buf.build/community/neoeinstein-prost-serde:v0.2.3
    out: gen/src
  - plugin: buf.build/community/neoeinstein-tonic:v0.3.0
    out: gen/src
    opt:
      - compile_well_known_types
      - extern_path=.google.protobuf=::pbjson_types
  - plugin: prost-crate
    out: gen
    strategy: all
    opt:
      - gen_crate=Cargo.toml

See example/build-with-buf for an example of invoking buf as part of a build.rs build script. This may be useful when you want to extend the generated files with additional trait or inherent implementations.

More Repositories

1

aliri

Web API access control for Rust
Rust
116
star
2

modyne

An opinionated Rust library for interacting with AWS DynamoDB single-table designs.
Rust
53
star
3

stats_alloc

Rust
44
star
4

bouncycastle

Bouncy Castle
C#
41
star
5

aliri_braid

Improve and strengthen your strings by making them strongly-typed with less boilerplate
Rust
30
star
6

purpleonion

The Purple Onion Router: a managed implementation of the Tor Onion Router
C#
15
star
7

Hopac.Plus

A collection of utilities that encapsulate common concurrency patterns and constructs for use with the Hopac concurrency library.
F#
13
star
8

msfs_vpilot_vmr

vPilot-compatible VMRs for matching plane models in MSFS
6
star
9

health

Rust
6
star
10

docker-fsharp-alpine

5
star
11

c5

The C5 Generic Collection Library for C# and the CLI
C#
5
star
12

TickSpec

A lightweight Behaviour Driven Development (BDD) framework. Describe behaviour in plain text using the Gherkin business language, i.e. given, when, then. Easily execute the behaviour against matching F# tick methods (let ``tick method`` () = true) or attributed C# or F# methods.
F#
5
star
13

freya-netcore-presentation

F#
4
star
14

HttpFs.Auth0

Provides constructs which make it easier to use Auth0 when interacting with protected APIs.
F#
4
star
15

githax

Tools and documents related to the Tor project's conversion from svn to git
Shell
3
star
16

xpdm.Bitcoin

C#
2
star
17

monads-are-not-burritos

Explaining monads to the uninitiated (a lightning talk)
F#
2
star
18

xpdm.Catan

C#
2
star
19

cqrs

Rust
2
star
20

xpdm

General Repository for things xallaraparadigm
C#
2
star
21

hopac-concurrency-with-synchronous-messaging

One of the four tenets in the Reactive Manifesto is asynchronous messaging, but what if we considered the alternative? Synchronous messaging may not be the sin we've all been warned against. Inspired by Concurrent ML and the concurrent synchronous processes model, we will discuss the concurrency primitives exposed by the Hopac library and how they can be composed to build highly-concurrent applications which benefit from lightweight threads, an optimized work scheduler, and the ability to react to multiple communication channels. All while avoiding some of the pitfalls of asynchronous messaging.
F#
2
star
22

docker-mono-alpine

1
star
23

FSharp-Lightning-Talk

F#
1
star
24

new_type_derive

Rust
1
star
25

HopacPresentation

A long-ish presentation on Hopac
F#
1
star
26

cj4-fadec

Rust
1
star